Move pictures to folder with name based in creation date and folder name

Started by rdmitre, August 21, 2015, 01:06:00 AM

Previous topic - Next topic

rdmitre

Hi all. Please excuse my english.

I have pictures in a folder as follow:

/mnt/mycloud/Pictures/image1.jpg
/mnt/mycloud/Pictures/image2.jpg
/mnt/mycloud/Pictures/imagen3.jpg
/mnt/mycloud/Pictures/foldername/image4.jpg
/mnt/mycloud/Pictures/foldername/image5.jpg 
/mnt/mycloud/Pictures/foldername/image6.jpg

I need to move or rename these pictures to:

/mnt/mycloud/Pictures2/2015/01/12/2015_01_12_10:23:34.jpg
/mnt/mycloud/Pictures2/2015/01/12/2015_01_12_10:23:48.jpg
/mnt/mycloud/Pictures2/2015/01/12/2015_01_12_10:25:39.jpg
/mnt/mycloud/Pictures2/2015/02/15_foldername/2015_03_15_11:25:45.jpg
/mnt/mycloud/Pictures2/2015/02/15_foldername/2015_03_15_11:26:23.jpg
/mnt/mycloud/Pictures2/2015/02/15_foldername/2015_03_15_11:26:29.jpg

Can you help me?

Phil Harvey

This is a bit tricky, and it would be best to create a user-defined tag to handle this logic.

I don't have time to do this right now, but if you are interested I will do it when I get a chance.

- 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 ($).

rdmitre


Phil Harvey

OK. Here you go.

The procedure is this:

1) download the attached config file to "/mnt/mycloud", and "cd" to that directory:

cd /mnt/mycloud/

2) First verify that you are getting the names you want:

exiftool -config myname.config -userparam DestDir=Pictures2 "-testname<myname" -r Pictures

3) If this looks good, then move/rename the files:

exiftool -config myname.config -userparam DestDir=Pictures2 "-filename<myname" -r Pictures

- 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 ($).


rdmitre

Phil, Thank for your support. How can I adapt this config file to rename MOV files from iPhone, in the same way?

Phil Harvey

Why do you think you need to adapt if for MOV files?  It should work for those too.

- 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 ($).

StarGeek

For videos you might have to add -api QuickTimeUTC to adjust the time from UTC to local time but otherwise, as Phil says, it should still work.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype