Page 1 of 1

script to rename file based on a string in the first line

Posted: 28 May 2008 09:20
by jkea
I need to write a batch file that will rename a file based on a string in the first line of the file (a header).

The routine will need to move to a certain position in the first line and read in the next, say 12 positions, into a variable, then name the file based on the string value that was passed to the variable.

Posted: 29 May 2008 13:56
by jeb
Hi Ikea,

take a look at the for /f "tokens=..." command, that should do the work for you.

jeb