326
General Software Discussion / Re: File Renaming question
« Last post by AndyM on January 04, 2010, 04:09 PM »I'd cobble together a one-time batch file (DecRename.bat), one line per file:
rename file7005 file7004
rename file7006 file7005
rename file7009 file7008
rename file7012 file7011
etc
Lot's of ways to make the batch file.
- Get a list of the current files, from a command prompt "dir>filelist.txt"
- Edit filelist.txt to get just a list of filenames.
- Paste the list into a column in Excel. Use a formula to decrement the file number (easy if it's always the same two digits) in another column. In a third column use a concatenation formula: +"rename "&firstcolumncell&" "&secondcolumncell
- Copy the third column and paste it into DecRename.bat
- Run DecRename.bat in the directory with the files
If you can quickly edit the filelist and do the stuff in Excel this shouldn't take long if the filenumbers are always the same distance from the end of the filename string. If the files are in numerous multiple folders you could generate a list with full paths using something different than the dir command.
This occurred to me first. There's probably an easier way...
rename file7005 file7004
rename file7006 file7005
rename file7009 file7008
rename file7012 file7011
etc
Lot's of ways to make the batch file.
- Get a list of the current files, from a command prompt "dir>filelist.txt"
- Edit filelist.txt to get just a list of filenames.
- Paste the list into a column in Excel. Use a formula to decrement the file number (easy if it's always the same two digits) in another column. In a third column use a concatenation formula: +"rename "&firstcolumncell&" "&secondcolumncell
- Copy the third column and paste it into DecRename.bat
- Run DecRename.bat in the directory with the files
If you can quickly edit the filelist and do the stuff in Excel this shouldn't take long if the filenumbers are always the same distance from the end of the filename string. If the files are in numerous multiple folders you could generate a list with full paths using something different than the dir command.
This occurred to me first. There's probably an easier way...