Rename files by means of a table
I want to create a graphic overview of the resource images from an executable file. It should look something linke this, but with the names of the resources as used within the program rather than just numbered.
There are good utilities to rename files according to rules, even based
on regular expressions. My favorite tool in this area is MultiRen by
Bruno Sonnino for PcMag.com. However, there are cases when no rules can be applied.
This happens, for example, if you extract resources from an executable file.
The single resource files are numbered and additionally you get a table for
corresponding resource name and file name. Hence I need a utility which reads
the given file names (for example,
data_5.bin) and the resource
and renames the files to new names with the correct extension (
The D+DD utility RenameByTable uses a table as input to rename files.
The table must have the format
old_name » new_name.
a TAB character):
Data_1.bin » P_ACCEPTALLCHANGE_18X18_N Data_2.bin » P_ACCEPTALLCHANGE_18X18_N_D Data_3.bin » P_ACCEPTALLCHANGE_18X18_R Data_4.bin » P_ACCEPTALLCHANGE_18X18_R_D ...
new_name may have distinct
extensions, but no content conversion is performed by the utility. Hence
only 'compatible' file types should be renamed with this method:
Data_1.mif » reasonable-name.txt Data_2.xml » toolbar-17.xml win03.htm » utility-one.html ...
For this rename method the "new destination" field must be left empty in the utility.
For example, using ResHacker to extract the png resources with Action
> Save [png] Resources, from
you get 137 distinct resource files (*.bin) and a table file, which you might
fmcustom.rc (the TAB character is visualized by
P_ACCEPTALLCHANGE_18X18_N PNG»"Data_1.bin" P_ACCEPTALLCHANGE_18X18_N_D PNG»"Data_2.bin" P_ACCEPTALLCHANGE_18X18_R PNG»"Data_3.bin" P_ACCEPTALLCHANGE_18X18_R_D PNG»"Data_4.bin" P_ACCEPTCHANGE_18X18_N PNG»"Data_5.bin" P_ACCEPTCHANGE_18X18_N_D PNG»"Data_6.bin"
For use of this table it must be modified to get the required format. A text editor allowing pattern matching (regular expressions) such as EditPad Pro is a handy tool for this task:
After this preparation the conversion table looks like this (» denotes a TAB).
Data_1.bin » P_ACCEPTALLCHANGE_18X18_N Data_2.bin » P_ACCEPTALLCHANGE_18X18_N_D Data_3.bin » P_ACCEPTALLCHANGE_18X18_R Data_4.bin » P_ACCEPTALLCHANGE_18X18_R_D ...And it can be fed into the utility.
The uitility allows to browse for the input and output files as well as to enter the file paths directly:
For our sample case, the resources from
fmcustom.dll we set up the utility
as follows. I recommend to avoid inplace renaming to be able correct mistakes
in a table.
Only source files listed in the table will be renamed.
Hence there may other files also in the source directory.
Help displays this page
Start the task with Rename. A final dialog gives you feedback:
My graphic tool for albums of this kind is Thumbs Plus. I have defined a setup for 6 pictures in a row for A4 output. The result I get for the originally extracted resources can be seen at top of this page - neither a good sort (since numbering is not with leading zeroes), nore intuitve to use.
After renaming the creation of a graphic overview may create some problems, because resource names may be quite long. So do not throw away the renaming table, as there you find the full names. I had to change from 6 to 4 columns to cope with the long file names: