Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #place multiple PDF in working directory - all PDF after conversion will be deleted
- rename 's/ /_/g' *.pdf
- find -iname '*.pdf' -exec pdftotext {} {}.txt \;
- find . -iname "*.txt" -exec sed -i "s/
- //g" '{}' \;
- for i in `ls *.txt`;do tr "\n" " " < $i > $i.2.txt ;done
- for i in `ls *.2.txt`;do sed -e "s/.\{1000\}/&\n\n/g" <$i>$i.3.txt ;done
- rm *.pdf.txt *.2.txt *.pdf
- rename "s/.pdf.txt.2.txt.3//g" *
- rename 's/_/ /g' *.txt
Advertisement
Add Comment
Please, Sign In to add comment