Hmmm, , , , Off Topic, , , ,

french fries.gif
 
I was flipping through channels this morning and for a moment I thought it was the cannabis (it's legal here) that was messing with my head but it turns out this really is a thing:

Excel is one of the most useful programs out there. Recently I've been using it to generate batch file commands to rename large quantities of file names in directories and sub-directories. Trying to change so many file names using just Dos Prompt commands just wouldn't do it, and of course the CMD line is not very forgiving if you make a mistake!
 
Excel is one of the most useful programs out there. Recently I've been using it to generate batch file commands to rename large quantities of file names in directories and sub-directories. Trying to change so many file names using just Dos Prompt commands just wouldn't do it, and of course the CMD line is not very forgiving if you make a mistake!
I'm curious how you do this in Excel.... I've always used Better File Rename (version 2.8), supports Windows 98 and newer
 

Attachments

  • bfr.jpg
    bfr.jpg
    124.3 KB · Views: 3
I'm curious how you do this in Excel.... I've always used Better File Rename (version 2.8), supports Windows 98 and newer
Perhaps your method is better? (I haven't used "Better File Rename", but I'll check it out.)

The Excel method is something like this....

1) Open Dos prompt in desired directory and type "dir/b > current.txt". Gives you a text file with just file names.
2) Open that text file with Notepad, save it as New.txt. Use Notepad Edit>Replace to alter existing file names.
3) Open Excel, copy/paste Current file names in first column, New file names in 2nd column, then formula in top cell of 3rd column:
="Rename"&" "&CHAR(34)&A2&CHAR(34)&" "&CHAR(34)&B2&CHAR(34)

With other formula's you can also delete leading and trailing characters, and make additional edits that might be easier than using Notepad.

Drag the + sign (lower right corner of cell) to duplicate formula down for as many files are in first two columns.

Then it's just copy that 3rd column into a new Notepad file, inspect it looks right, and save it as Rename.bat. Place the batch file in directory where files are located, double click it (or type "rename" at dos prompt).... all done.

If the changes you want to make to the original file names are all very similar, then Notepad actually does most of the work for you creating the new file names. Excel is only used to create the single line "rename" commands.

For Mp3 audio files I like to use "Tag&Rename" to get the file names and the tags to my liking, but sometimes I have to alter the file name first with the above method to then update the Tag.... depends on who created each element of the original file.
 
Last edited:
Yeah for MP3 I like to use Tag Frontend because Casey's tag.exe is almost instant with ID3V1. For ID3V2 or M4A, I use EasyTag. A bit cumbersome, but it gets the job done on XP. Sometimes I even add the album art with dbPowerAmp.
 
Back
Top