Page 1 of 1

renaming file with first line in text

PostPosted: Mon Jul 09, 2012 7:35 am
by sam_111
I would like to rename a batch of txt file with the first line of each file.

could someone guide me on how to do it?

thank you in advance

Re: renaming file with first line in text

PostPosted: Mon Jul 09, 2012 6:17 pm
by fiddly bits
I don't think that BRU actually looks inside the text contents of a file.

You might want to try something like the very powerful AutoIT scripting language instead.

The algorithm should be quite easy:
Code: Select all
Select a folder
Process all files within it (recursion loop)
-Open file
-Read first line of file
-Close file
-Rename file
Continue loop

Alternately just use AutoIT to read the first line and write it to a text file that can be used as the input for the Bulk Rename Utility.

See discussion at http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=4&t=1502 as well.