exiftool not editing SOME pdf files

Started by trudge, June 02, 2024, 04:15:03 PM

Previous topic - Next topic

trudge

I've been happily using exiftool for several years but have recently had an
issue with some pdf files. These files are extracted from existing pdf files
(journals or books) and are extracted using the Preview app on my iMac.

I have a bash script that adds an 'Author' and 'Title' tag to each file, and it
works for most files, but does not work on some files. However, I can edit the
files individually with exiftool from the CL successfully.

At first I thought it was a permissions or access problem, but all files are
rwxrw-rw-@. And I don't have to 'sudo' to edit manually. I would appreciate any
help resolving this issue. It seems to be related to running exiftool in a bash
script. Or perhaps some meta-tag is causing a problem? I can post the meta-tags
for one of these files if needed.

Working on a MacOS M1 running Sonoma 14.5 with bash 5.2.15(1).

StarGeek

I'm not sure what we can help with. If the file can be edited correctly from the command line, then that seems to indicate there's a problem with your script some place.  And even if you shared the script, that isn't something I can help with since I'm on Windows and know nothing about bash scripts, but someone else might see a problem.
"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

trudge

I believe I've discovered the problem. The Title of a document was pulled from an sqlite database, and some of the titles ended with a question mark (?). This confused the bash script, because it was trying to use the title as the filename to open. I updated the DB to delete the '?' from any titles. And so far the script has run without throwing errors.

A learning opportunity for me certainly, and maybe for others.

StarGeek

Quote from: trudge on June 02, 2024, 05:24:14 PMThe Title of a document was pulled from an sqlite database, and some of the titles ended with a question mark (?). This confused the bash script, because it was trying to use the title as the filename to open.

This if file globbing, I believe. If so, then you should also watch for asterisks as well.  And maybe you could escape them or quote them instead of deleting?
"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