Batch file renaming (replacing strings) & directory listing
by SakuraarukaS - 5/6/12 11:56 AM
Ahhh, this is hard. Well, I need something like this.
I have a bunch of files (~1000) and a text file. Text file has lots of strings like this
"Original name" "New name"
I need a program to look recursively in a specified directory and change all instances of "Original name" to "New name", for both files and folders. The formatting of the text file can be different ofc, I don't care. But it has to be something along "old name" <separator> "new name". Note that "old name" and "new name" aren't a file name by itself, just part of the name of X number of files.
I normally use Bulk Rename Utility, great proggie. But it hasn't got a string replacer. It can just rename entire files from a text file, like this
Original File.mkv|New File.mkv
Doing that for thousands of files is a pain. I've found utilities more or less like the one I need, but they are all paid. I can't convert currency or get money out of the country, so even if I want I can't pay :P. It has to be a freeware. Any ideas?
Aside that I need something to make a list in a text file of all files in a directory (recursively and files only, not folders). The Windows "dir" command with the "/s" switch (for listing recursively a directory) always appends the full path before the files, even if I use the switch for bare format "/b" (removing the "/s" and leaving "/b" gives only the file names, like I want, but from a single folder). Unless there's a special way of using "dir", it simply doesn't work for me
And now that I think of it, it could be instead something to remove everything behind the first "\" counting from the right (to remove paths from the "dir" list) on all lines of the text file :P
Any ideas? :-\