Using the -P (preserve) option: doubts

Started by demianill, January 10, 2017, 08:59:10 AM

Previous topic - Next topic

demianill

Hi All !  Brazilian congratulations !

Forgive my poor English ! (Portuguese is my native language)
This is my first post.

I found ExifTool yesterday, it is complex and fascinating !

My needs are simple (I believe...)

I have a folder/subfolders with thousands of images (more than 40.000)  and I use Fotoware/Fotostation to manage this assets.
We don't know why (this is not the question here), but in many keywords are blanks spaces after the keyword.
Examples: "Navio    "  or "Navio  "  or "Navio              " 

I used ExifTool to create a .csv file with the filename and all keywords for each image.
Then, I edited this file and made corrections of the wrong keywords.
Finally, I tried to update the keywords in the images, using the -P option to preserve the original modification date of the files.
This is very importante for us and we cannot modify the original time/date of the files.

Fortunately, I did this in a test environment, not in the original files/folders, but in a backup in my local station.
I used the following command-line:

exiftool -csv=script-muda-keywords-teste.csv -ext jpg -sep ";" -P /Volumes/BKP_Servidor_Fotostation
where script-muda-keywords-teste.csv is the name of my csv file and /Volumes/BKP_Servidor_Fotostation is the path of the directory with the images

What happened ? The original time/date of the files were preserved, but the keywords are not replaced by the new ones.
So, I tried using the same command-line without the -P option and all keywords were inserted correctly, but the timestamp of the files changed.

exiftool -csv=script-muda-keywords-teste.csv -ext jpg -sep ";" /Volumes/BKP_Servidor_Fotostation

What are wrong ? Where is my mistake ?


Thanks for all your help !!!

Best regards,


Demian Nill




Below is little part of my csv file, just to illustrate:

SourceFile,Keywords
/Volumes/BKP_Servidor_Fotostation/Dig44806.jpg,"Urucu;Bacia_do_Solimões;Bacia_terrestre;UO-AM;E_e_P_Unidade_de_Operações;Reciclagem_de_lixo"
/Volumes/BKP_Servidor_Fotostation/Dig44807.jpg,"Bacia_do_Solimões;Urucu;Diversos;Transportes;Aeronaves;UO-AM;Aeroporto"
/Volumes/BKP_Servidor_Fotostation/Dig44808.jpg,"Bacia_do_Solimões;Urucu;Diversos;Transportes;Aeronaves;UO-AM;Aeroporto"
/Volumes/BKP_Servidor_Fotostation/Dig44809.jpg,"Urucu;Bacia_do_Solimões;Bacia_terrestre;UO-AM;E_e_P_Unidade_de_Operações;Empregados;Empregados_produção;Unidade_de_produção;Árvore_de_natal"
/Volumes/BKP_Servidor_Fotostation/Dig44810.jpg,"Urucu;Bacia_do_Solimões;Bacia_terrestre;UO-AM;E_e_P_Unidade_de_Operações;Empregados;Empregados_produção;Unidade_de_produção;Árvore_de_natal"
/Volumes/BKP_Servidor_Fotostation/Dig44811.jpg,"Urucu;Bacia_do_Solimões;Bacia_terrestre;UO-AM;E_e_P_Unidade_de_Operações;Empregados;Empregados_produção;Árvore_de_natal;Unidade_de_produção"
/Volumes/BKP_Servidor_Fotostation/Dig44812.jpg,"Urucu;Bacia_do_Solimões;Bacia_terrestre;UO-AM;E_e_P_Unidade_de_Operações;Empregados;Empregados_produção;Unidade_de_produção;Árvore_de_natal"
/Volumes/BKP_Servidor_Fotostation/Dig44813.jpg,"Urucu;Bacia_do_Solimões;Bacia_terrestre;UO-AM;E_e_P_Unidade_de_Operações;Empregados;Empregados_produção"
/Volumes/BKP_Servidor_Fotostation/Dig44814.jpg,"Administração;Presidente;João Ninguém"
/Volumes/BKP_Servidor_Fotostation/Dig44815.jpg,"Administração;Presidente;João Ninguém"
/Volumes/BKP_Servidor_Fotostation/Dig44816.jpg,"Administração;Presidente;João Ninguém"
/Volumes/BKP_Servidor_Fotostation/Dig44817.jpg,"Administração;Presidente;João Ninguém"
/Volumes/BKP_Servidor_Fotostation/Dig44818.jpg,"Administração;Presidente;João Ninguém"
/Volumes/BKP_Servidor_Fotostation/Dig44819.jpg,"Administração;Presidente;João Ninguém"
/Volumes/BKP_Servidor_Fotostation/Dig44820.jpg,"Pólo_pré-sal;E_e_P_Pré-sal;Estaleiro;Construção_naval;Engenharia;E_e_P_Produção;FPSO;P.66"
/Volumes/BKP_Servidor_Fotostation/Dig44821.jpg,"Pólo_pré-sal;E_e_P_Pré-sal;Estaleiro;Construção_naval;Engenharia;E_e_P_Produção;FPSO;P.66"
/Volumes/BKP_Servidor_Fotostation/Dig44822.jpg,"Pólo_pré-sal;E_e_P_Pré-sal;Estaleiro;Construção_naval;Engenharia;E_e_P_Produção;FPSO;P.66"
/Volumes/BKP_Servidor_Fotostation/Dig44823.jpg,"Pólo_pré-sal;E_e_P_Pré-sal;Estaleiro;Construção_naval;Engenharia;E_e_P_Produção;FPSO;P.66"
/Volumes/BKP_Servidor_Fotostation/Dig44824.jpg,"Pólo_pré-sal;E_e_P_Pré-sal;Estaleiro;Construção_naval;Engenharia;E_e_P_Produção;FPSO;P.66"
/Volumes/BKP_Servidor_Fotostation/Dig44825.jpg,"FPSO;Produção;P.68;Casco autoreplicante;P-68"

Phil Harvey

I don't know why the files aren't getting updated with the -P option.  Everything looks good to me.  However you can do this more easily without the need to go through a CSV file by using the API Filter feature:

exiftool -api 'filter=s/ +$//' -tagsfromfile @ -keywords -P DIR

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