Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- #
- # nejm_pdf_rename
- #
- # Author: Mark Ruff
- #
- # Strips the title out of a pdf file and renames the pdf accordingly.
- # Written for NEJM clinical practice guidelines. Will need modification
- # to work with other files (hopefully not much)
- # Standard line of text which allows us to find the title
- MARKER="clinical practice"
- # Number of lines below the MARKER that the titlte appears
- LINES=2
- for FILE in $@
- do
- mv "$FILE" "$(less "$FILE" | grep -A $LINES -m 1 "$MARKER" | sed -n -e "$((LINES+1)) p").pdf"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement