0

I am currently working with large datasets and I want to use pandas to loop through and create one csv file. All my files are currently pdfs and I am using Camelot to make the file into a csv file but it exports as a zip file with each page as a new file into a zip folder. How can I loop through? I used an example listed on stackoverflow but it did not work and I received: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escap

import camelot
import pandas as pd
import os
import glob
tables = camelot.read_pdf('F_1.pdf', pages='6-9', flavor='stream' )
print(tables[1])
tables.export('F_1.csv', f='csv', compress = True)

os.chdir('C:\me\F_1.zip')
FileList = glob.glob('*.xlsx')
print(FileList)
BigBen
  • 46,229
  • 7
  • 24
  • 40
  • This looks like an issue with your path definition, see: https://stackoverflow.com/questions/37400974/error-unicode-error-unicodeescape-codec-cant-decode-bytes-in-position-2-3 – mcvincekova Jul 24 '23 at 08:32

0 Answers0