Last active
August 29, 2015 14:07
-
-
Save DavyLandman/c0dd99cdbee35d1a9a4e to your computer and use it in GitHub Desktop.
Rename pdf's based on metadata (requires pdfinfo from the poppler package)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It uses the pdf meta data to rename the file to the title of the pdf | |
# on osx it requires poppler installed: brew install poppler | |
find . -type f -name "*.pdf" -exec sh -c 'mv "$0" "$(pdfinfo $0 | sed -n "/^Title/ s/Title:\(.*\)/\1.pdf/p" | sed "s/^[ \t]*//" | sed -e "s/[^A-Za-z0-9._-]/_/g")"' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment