Problem with parameter -p

Started by BertV, July 23, 2021, 07:40:39 AM

Previous topic - Next topic

BertV

Hello
I have used in the paste this syntax:
exiftool -csv -directory -FileName -Caption-Abstract -datetimeoriginal -filemodifydate -CreateDate -gpsaltitude
-gpslatitude# -gpslongitude# -r [path from] > [path to]\AllPhotos.csv
Now I want to change , between the tags with ;
I have read I can use a file with exif fields

This is my file (ExifTags.txt)
#[HEAD]FileName;Caption;DateTimeOriginal;Filemodifydate;CreateDate;GPSAltitude;GPSLatitude;GPSLongitude;Directory
$FileName;$Caption-Abstract;$datetimeoriginal;$filemodifydate;$CreateDate;$gpsaltitude;$gpslatitude#;$gpslongitude#;$directory

This is the new syntax:
exiftool -p ExifTags.txt -r [path from] > [path to]\AllPhotos.csv
The output is working with ; but...
There is no linefeed in csv file. So everything is in just one row

How can I solve this issue?

ryerman

#1
From the documentation:
Quote"Use $$ to represent a $ symbol, and $/ for a newline."
https://www.exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat

You might want to add the -m option, to avoid skipping files where any of the fields are missing.
Windows 10 Home 64 bit, Exiftool v12.61

StarGeek

You can also make sure that your ExifTags.txt file has a linefeed at the end of each line.  That made sure that each file was listed on a separate line for me.

"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

BertV

Great software en great help from users Thank you.
The solution from ryerman looks OK but... The last column ends with a semicolon. Of course I can remove the semicolon but I hope there is another solution. Maybe the solution from StarGeek is the best option but how do I add CR LF to ExifTags.txt. I can't copy it from his post because it is an image.
By the way I have added the -m parameter as an extra parameter.

StarGeek

Quote from: BertV on July 23, 2021, 12:32:30 PMMaybe the solution from StarGeek is the best option but how do I add CR LF to ExifTags.txt. I can't copy it from his post because it is an image.

Just open up your ExifTags.txt, go to the end of the second line, hit enter and then save. You just need to make sure there's an extra blank line in the file.

The image I posted was from NotePad++ with the View menu->Show Symbol->Show End of Line option selected so you could better see what I was talking about.  You wouldn't normally see the CRLF part in most programs.
"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

BertV

Thank you very very much StarGeek!
Perfect solution :)

ryerman

Quote from: BertV on July 23, 2021, 12:32:30 PM
The solution from ryerman looks OK but... The last column ends with a semicolon.
That seems odd. There are no extra semicolons in my csv file.
Windows 10 Home 64 bit, Exiftool v12.61

BertV

Sorry ryerman for my late reaction.
I have checked my ExiftTags.txt file. I made a mistake. At the end of the second line I have added ;$/ After reading your post I have changed it to only $/ and now it works the way you suggested. Sorry for the misunderstanding. Thank you!

ryerman

Quote from: BertV on July 25, 2021, 03:36:51 AM
....At the end of the second line I have added ;$/ After reading your post I have changed it to only $/ and now it works the way you suggested....
Thanks for confirming my suspicions!  :)
Windows 10 Home 64 bit, Exiftool v12.61