Link to home
Start Free TrialLog in
Avatar of Charles Baldo
Charles BaldoFlag for United States of America

asked on

Robocopy output remove leading spaces in log file

Hi

I am using Robocopy to copy files.  I want to only see the directory and filename and send it to a log file.

this works well:

robocopy g:\2d\gt\ g:\test /mir /njh /njs /fp /ns /np /nc /log:rout.txt

only problem is I get a leading space pad in rout.txt

                          g:\2d\gt\0001002DGT07
                          g:\2d\gt\0001002DGT08
                          g:\2d\gt\0001002DGT09
                          g:\2d\gt\0001002DGT0A
                          g:\2d\gt\0001002DGT0B

would like to get

g:\2d\gt\0001002DGT07
g:\2d\gt\0001002DGT08
g:\2d\gt\0001002DGT09
g:\2d\gt\0001002DGT0A
g:\2d\gt\0001002DGT0B

I could write a script to clean up after, but would be good to get it all in the Robocopy command
Avatar of Bill Prew
Bill Prew

I've seen this mentioned before and I've never seen anyone find a solution that involved getting ROBOCOPY to write the log file with no spaces or tabs before the filenames.  The questions I have seen about this always ended up back with post processing the log file to remove extra spacing on the lines.  Sorry...

~bp
ASKER CERTIFIED SOLUTION
Avatar of Grant Brunton
Grant Brunton
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If anyone finds the fix I too would love to know.

I started using Robocopy since the NT4 days and the logging didnt truncate the output like it does now...anyone from MS listening to these posts?
post processing is the one way I've been able to handle this, (whether in-line with a for-loop or running after the fact) the padding has been written into robobopy directly.. it's like any command you have to deal with how it formats, it just sucks how robobopy formats.
Avatar of Charles Baldo

ASKER

Thank you all