I put a script here to do this, but I, uh, think it needs some work...be back later...
Hmm...this might do it..just copy it into a text file, chmod it, throw it in a folder with some pdfs and execute! it's better than the code above because it works with filenames with spaces, & cr\#az(y) $ymbol$ and stuff...you should be safe, exiftool makes backups unless you tell it not to. Your path to exiftool may vary, just edit the line beginning "sed 's/^/"
#!/bin/bash
ls -1 *.pdf | sed 's/\(.*\)\..*/\1/' > names.txt
ls -1 *.pdf > names2.txt
cat names.txt | sed 's/^/"/' | sed 's/$/"/' > names3
cat names2.txt | sed 's/^/"/' | sed 's/$/"/' > names4
awk 'NR==FNR{a[FNR]=$0;next} {print a[FNR],$0}' names3 names4 > newnames
sed 's/^/exiftool -Title=/' newnames > script
chmod +x script
./script
rm names.txt
rm names2.txt
rm names3
rm names4
rm newnames
rm script
exiftool -delete_original *.pdf
#END
If i actually knew what i was doing, I am sure it would be more elegant. There are plenty of ludicrous commands in that script i'm sure. It works though!
Last edited by darkbeanies; 08-14-2011 at 07:28 PM.
|