Rename file in folder with the folder name
stuff
December 16th 2014 (9 years ago)
Rename file in folder with the folder name Recently i was sent a large number of files with random names(5000+), sorted into folders (the name of the folder is the name of the product), the point was to have all files within the folder named as folder(“name_of_product”), with proper numbering like that:
name_of_product_1.jpg
name_of_product_2.jpg
name_of_product_3.jpg
name_of_product_4.jpg
etc…

for linux users, that is not a problem, for Windows users, you need to get “creative”, simplest solution?
Use Total Commander
. This tool makes a lot of file operation reeaaallly faster and easier than normal.

I assume you already have the files you need to be renamed sorted into folders, let’s start:
  • Go to the single folder containing all the files for one product
  • Press CTRL+B (this will make a flat list of all files)
  • Mark all the files with CTRL+A
  • Press CTRL+M
  • In Rename Mask replace [N] with [P]_[C]
  • Press Enter
Unfortunately, those steps needs to be repeated for each folder, as Total Commander does not allow resetting the counter, but there is a very simple macro to create for that in Autohotkey, i may show you how to do it next time :).