View Single Post
Old 08-21-2011, 11:07 AM   #10
darkbeanies
Member
darkbeanies began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2011
Device: none
And here is a solution for the Tags...works for pdfs in current directory. Very slow and painful.

#!/bin/bash

#DarkbeaniesMegaDeliminationScript

ls *.pdf > ~/test1
cat ~/test1 | sed 's/^/"/' | sed 's/$/"/' > ~/test2
sed 's/^/exiftool -Keywords /' ~/test2 > ~/test3
chmod +x test3
./test3 > ~/test4
cat ~/test4 | sed 's/\<Keywords\>//g' > ~/test5
cat ~/test5 | sed "s/://g" > ~/test6
cat ~/test6 | sed 's/^[ \t]*//' > ~/test7
cat ~/test7 | sed 's/[ \t]*$//' > ~/test8
cat ~/test8 | sed 's/, /\;\ /g' > ~/test9
cat ~/test9 | sed 's/^/"/' | sed 's/$/"/' > ~/test10
awk 'NR==FNR{a[FNR]=$0;next} {print a[FNR],$0}' ~/test10 ~/test2 > ~/test11
sed 's/^/exiftool -Keywords=/' ~/test11 > ~/test12
chmod +x ~/test12
./test12

Apparently works for author too. Just replace "Keywords" with "author", and the comma with an ampersand I guess...

Last edited by darkbeanies; 08-21-2011 at 11:16 AM.
darkbeanies is offline   Reply With Quote