News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Renaming and Numbering Images in Multiple Folders

Started by Alyssa, March 16, 2016, 01:50:57 PM

Previous topic - Next topic

Alyssa

Hello
I'm trying to numbering about 2.000 images in about 50 different folders, I tried some commands I found reading other threads and the Faq in
http://www.exiftool.org/filename.html#ex6
But the only working result was renaming all images to an incremental numbering sequence(e.g. first folder were named like 1 to 55 then in the next folder they were named like 56 to 102 and so on),which could be quite messy.

I'm simply trying to append Folder name to each file within(e.g. Folder "Chapter 1" to each Image "Chapter 1 - 001.jpg"/"Chapter 1 - 002.jpg" and so on),and numbering then sequentially but individually for each folder(so within each folder the numbering starts back from 001),also with a 3-digit numbering (e.g. 001,002,003 etc. instead of 1,2,3 etc.).

Off course renaming using existing alphabetical order(I've read I have to specify it with -fileorder directory -fileorder filename if that's correct),thanks.

Phil Harvey

You want to keep the original file name and just append the folder name and a number, starting at 1 for reach folder?

This is tricky.  I would have to think about this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alyssa

No no, original filename doesn't matter,just the folder name and numbering(e.g. Folder Name-001;Folder Name-002;Folder Name-003;etc.)

Phil Harvey

OK, this is easier then:

exiftool -fileorder filename "-filename<${directory;s(.*/)()}-%.3nc.%e" -r DIR

Try this writing "testname" instead of "filename" first to be sure it is doing what you want.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alyssa

Tried with both filename and testname and only 1 file per folder was updated with names like:
...
Chapter 05-e
Chapter 06-e
etc.
(Files were without an extension).
All the updated files were the first ones(in alphabetical order) in each folder,all others files were untouched.

Phil Harvey

All "%" characters must be doubled if you run this command from a .BAT file (FAQ 27)
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alyssa

Oh right sorry  ;D its been a long time and I forgot about that.

Yeah now it works perfectly thanks  :)