Skip to content

Instantly share code, notes, and snippets.

@tsainte
Created January 20, 2019 12:01
Show Gist options
  • Save tsainte/bb6a90baecee6a6a4fa499774f6495bb to your computer and use it in GitHub Desktop.
Save tsainte/bb6a90baecee6a6a4fa499774f6495bb to your computer and use it in GitHub Desktop.
Script for renaming pdf files from Lingoda to meaninful names
# Script for renaming pdf files from Lingoda to meaninful names
# PDF titles from metadata as file name
# Dependency: brew install exiftool
for file in *.pdf
do
mv "$file" "$(exiftool $file -title -s -s -s | cut -d':' -f 2 | cut -c 2-50 | cut -d'[' -f 2 | cut -d']' -f 1).pdf"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment