Skip to content

Instantly share code, notes, and snippets.

Last active July 22, 2016 00:14
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Fulcrum PDF reports are named with the record's unique fulcrum_id. This bash script loops through the parent CSV file and renames the PDF files based on the index of user-specified fields.
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read -a csv_line
mv ${csv_line[0]}.pdf ${csv_line[8]}-${csv_line[0]}.pdf
done < $INPUT
FOR /F "usebackq tokens=1,2,26 delims=," %a IN (fire_hydrants.csv) DO ren %a.pdf "%c.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment