how to convert pdf file to excel file using python

Yuvraj Singh picture Yuvraj Singh · Nov 4, 2019 · Viewed 19k times · Source

I want to convert a pdf file into excel and save it in local via python. I have converted the pdf to excel format but how should I save it local?

my code:

df = ("./Downloads/folder/myfile.pdf")
tabula.convert_into(df, "test.csv", output_format="csv", stream=True)

Answer

skaul05 picture skaul05 · Nov 4, 2019

You can specify your whole output path instead of only output.csv

df = ("./Downloads/folder/myfile.pdf")
output = "./Downloads/folder/test.csv"
tabula.convert_into(df, output, output_format="csv", stream=True)

Hope this answers your question!!!