0

I'm new to Python and I have problem, its gonna be great having solution from all of you here.

I have a 23 pages PDF file and I want to convert it to separate .csv file for each page. How could I iterate over the pages in the file name using Tabula?

My current code has a syntax error:

import numpy as np
import pandas as pd
import tabula as tb

df = tb.read_pdf("Source.pdf", pages = "all")[0]
rg = list(range(1,24,1)) //creating list of pages

//iterate over the pages to create multiple csv file based on the pages
for x in rg :
    tb.convert_into("Source.pdf", x'.csv', output_format = "csv",pages = x, lattice = True)
    print(df)

Hope I can learn more and have a solution on my problem.

Thanks in advance

import numpy as np
import pandas as pd
import tabula as tb

df = tb.read_pdf("Source.pdf", pages = "all")[0]
rg = list(range(1,24,1)) //creating list of pages

//iterate to create multiple csv file based on the pages
for x in rg :
    tb.convert_into("Source.pdf", x'.csv', output_format = "csv",pages = x, lattice = True)
    print(df)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0