rucinski69

Multiple pdf 4 fb reader

May 4th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. #!/bin/bash
  2. #place multiple PDF in working directory - all PDF after conversion will be deleted
  3. rename 's/ /_/g' *.pdf
  4. find -iname '*.pdf' -exec pdftotext {} {}.txt \;
  5. find . -iname "*.txt" -exec sed -i "s/
  6.                                      //g" '{}' \;
  7. for i in `ls *.txt`;do tr "\n" " " < $i > $i.2.txt ;done
  8. for i in `ls *.2.txt`;do sed -e "s/.\{1000\}/&\n\n/g" <$i>$i.3.txt ;done
  9. rm *.pdf.txt *.2.txt *.pdf
  10. rename "s/.pdf.txt.2.txt.3//g" *
  11. rename 's/_/ /g' *.txt
Advertisement
Add Comment
Please, Sign In to add comment