Advertisement
metalx1000

Payroll PDF to Text from mbox mail file

Jun 20th, 2019
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. tmpdir="mboxtmp"
  4. password="password"
  5.  
  6. rm -fr "$tmpdir"
  7. mkdir $tmpdir
  8. ripmime -i GNFD -d $tmpdir
  9.  
  10. #loop until PDFs are extracted
  11. while [ 1 ];do
  12.   for i in  $tmpdir/textfile*;do
  13.     ripmime -i $i -d  $tmpdir;
  14.   done
  15.   ls  $tmpdir/*.PDF && break || echo "Continuing Scan..."
  16. done
  17.  
  18. for p in  $tmpdir/*.PDF;do
  19.   pdftotext -layout "$p" -upw $password -
  20. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement