What formula to have name and time of photos on one line, with sum of photos ?

Started by dantou, April 16, 2025, 10:35:36 AM

Previous topic - Next topic

dantou

Hi, I have been looking for hours and in despair for hours >:( , I am addressing you.
I would like to edit by directory, the name and date and time of my photos on a single line, with the number of directories and photos found at the end.
What formula should I use?  ::)
Cheers. ;D

Phil Harvey

I'm sorry.  I have read your post 5 times and still don't understand what you are asking.  Please be specific because we can't provide you with a command line unless you provide enough details about what you want to do.

- 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

Quote from: dantou on April 16, 2025, 10:35:36 AMwith the number of directories and photos found at the end.

Exiftool will automatically list the number of directories and files processed at the end of any command. For example, there 13 files available for this command, but only 10 are files that exiftool will process
C:\>exiftool -G1 -a -s -r -filecreatedate=now Y:\!temp\x\y
    2 directories scanned
   10 image files updated

Are you saying you want to use a date from the directory name and embed it in the file?
"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

dantou

Thank you for your attention.
What I'm trying to get is certainly very simple. But in my tests, when I add an option, the result obtained completely changes presentation, or disappears or ...
At the start I left on:
$ exiftool -p '$filename, $dateTimeOriginal' -q -f Dir/Dir/2025/2025-01-01 >out.txt
and i obtain a great part of what I want, but I miss the totals at the bottom of the file
Here is what I want to get:
/DIR/DIR/2025/2025-01/2025-01-01/O_20250101_592.jpg, 2025:01:01 00:06:39 >>>>> on one line only
.../...
/DIR/DIR/2025/2025-01/2025-01-01/E_20250101_189.jpg, 2025:01:01 00:08:36
/DIR/DIR/2025/2025-01/2025-01-01/O_20250101_587.jpg, 2025:01:01 00:06:01

And to this I want to add, at the end of the file.txt file obtained:
"  162 directories scanned
10605 image files read"
So I can gradually control the changes, deletions etc ... The evolution of my photos

StarGeek

"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

dantou

I've tried with removing the -q option, or the -f and so on, but the result is the same.
I got directories and files processed at the end of the process, but not on the listing :
$ exiftool -p '$filename, $dateTimeOriginal' -f Dir//Ap_2000/2000/* > /home/dan/A_traiter/Conflict/Photos_essai1.txt
.../...
Ap_2000/2000/2000-11_VacT_Briancon/ChapelleR_6700.jpg.xmp
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - Images/Ap_2000/2000/2000-11_VacT_Briancon/EcrinR_6800.jpg
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - Images/Ap_2000/2000/2000-11_VacT_Briancon/ChapelleR_6700.jpg
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - Images/Ap_2000/2000/2000-11_VacT_Briancon/MurR_6800.jpg.xmp
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - Images/Ap_2000/2000/2000-11_VacT_Briancon/MurR_6800.jpg
Warning: [minor] Fixed incorrect URI for xmlns:MicrosoftPhoto - Images/Ap_2000/2000/2000-11_VacT_Briancon/lautaret_001.jpg
  162 directories scanned                   <<<<<<<< I want this i the /Photos_essai1.txt
10605 image files read

StarGeek

I don't think it's possible. That listing is sent to STDERR, so it won't normally get written when you redirect the output.

You could use this, but that will place it at the beginning of the text file, not the end
exiftool -p '$filename, $dateTimeOriginal' -f Dir//Ap_2000/2000/* > /home/dan/A_traiter/Conflict/Photos_essai1.txt 2>&1

Or you could log it to a separate file with
2>/path/to/file.txt

You would want to use the -m (-ignoreMinorErrors) option to suppress those Fixed incorrect URI warnings.
"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

dantou

It's OK, but it's on 2 lines  :'(
======== Images/Ap_2010/2010/2010-01/2010-01-03/B_20100103_036.jpg.xmp
02:37:57  dim., janvier  3, 2010
======== Images/Ap_2010/2010/2010-01/2010-01-03/B_20100103_012.jpg
02:04:27  dim., janvier  3, 2010
.../...
  162 directories scanned
10605 image files read

StarGeek

"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

dantou

Good evening,
Suddenly I do with it, but I encounter a bizarre problem:
I get this:
lautaret_001.jpg.xmp, 2000:11:11 15:30:19
EcrinR_6800.jpg.xmp, 2000:11:11 15:35:10
ChapelleR_6700.jpg.xmp, 2000:11:11 15:35:10
And when I copy it to Excel, it gives it!
2000:11:11    01/01/1900 15:30
2000:11:11    01/01/1900 15:35
2000:11:11    01/01/1900 15:35
Why ?

StarGeek

That would be a question for someone who uses Excel, though I would guess it is because of the way the date is formatted.

Try adding
-d "%Y-%m-%d %H:%M:%S"

If you're using a Windows BAT file, see FAQ #27, My ExifTool command doesn't work from a Windows .BAT file.
"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

dantou

Yes that's it!
Thank you very much to everyone, dan

[Oui c'est bien ça !
Merci beaucoup à tous
Cordialement, Dan]