Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. dest_path = '/usr/frisby/databig/done/'
  2. source_path = '/usr/frisby/databig/'
  3.  
  4. import os
  5. import pdftotext
  6.  
  7. for files  in os.walk(source_path, topdown=False):
  8.         for name in files:
  9.                 with open(source_path, name, 'rb') as input_file:
  10.                         output_file = os.system("pdftotext '%s'" % (input_file))
  11.                         complete_name = os.path.join(dest_path, name + '.txt')
  12.                         f1 = open(complete_name, "w")
  13.                         f1.write(output_file)
  14.                         f1.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement