0

I have created cmd batch file to run several R script and each script have their own log files in same folder like below :

coc_prod_xgb.log
ds_prod_xgb.log
ccpa_prod_xgb.log
pletb_prod_xgb.log

and many more

Then I merge all text files into 1 log file

copy *.log all_log.log

The problem is sometimes there are errors on different jobs, so I need to know on which log this error occurs. Currently I have to open each log file one by one, because in the merged log file, I can't identify which log file that has this error.

How to modify above copy code so it will write file names on the 1st row then the next row will be log information and append the same process to next file

Compo
  • 36,585
  • 5
  • 27
  • 39
Anshari
  • 23
  • 3

1 Answers1

0

I can't find any option for cmd copy code to write file name, so i find another solution from this question.

Easiest way to add a text to the beginning of another text file in Command Line (Windows)

so it serve my needs, eventhough i have to write each block of code for each log file. but only for 1 time effort

Anshari
  • 23
  • 3