batch file editing

May 22, 2011 at 06:47:32
Specs: Windows 7
Hello..

I have a dir output txt that looks like this:

05/22/2011 04:37 PM 0 file (3).txt
05/22/2011 04:37 PM 0 file (8).txt
05/22/2011 04:37 PM 0 file (1).txt
05/22/2011 04:37 PM 0 file (10).txt
05/22/2011 04:37 PM 0 file (11).txt
05/22/2011 04:37 PM 0 file (12).txt
05/22/2011 04:37 PM 0 file (13).txt
05/22/2011 04:37 PM 0 file (2).txt
05/22/2011 04:37 PM 0 file (7).txt
05/22/2011 04:37 PM 0 file (4).txt
05/22/2011 04:37 PM 0 file (5).txt
05/22/2011 04:37 PM 0 file (6).txt
05/22/2011 04:37 PM 0 file (9).txt
..........
and so on....

What i need is a batch code that will remove the file names because i interested only in the dates and time.
Something like:
FOR each line remove all characters after the 20th one...

thanks


See More: batch file editing

Report •


#1
May 22, 2011 at 07:40:56
after learning the FOR loop i managed to write this code:

FOR /F "tokens=1,2 skip=4" %%G IN (c:\files\raw.txt) DO ECHO %%G %%H >>dates.txt


Report •
Related Solutions


Ask Question