5
tabula.convert_into(filename_final, (filename_zero + '.csv'), 
                    output_format="csv", pages="all")

How would I go about converting just pages 2 through the end? The "area" changes for the convert from page 1 through the rest of the pages.

I am using the Python wrapper tabula-py

Thanks in advance!

AlliDeacon
  • 1,365
  • 3
  • 21
  • 35

2 Answers2

5

According to the README, the pages argument can be:

pages (str, int, list of int, optional)
- An optional values specifying pages to extract from.
- It allows str, int, list of int.

Example: 1, '1-2,3', 'all' or [1,2]. Default is 1

So I guess you can try something like '2-99999'.

Paulo Scardine
  • 73,447
  • 11
  • 124
  • 153
1

Tabula-py - pages argument

from tabula import convert_into
table_file = r"Table.pdf"
output_csv = r"Op.csv"
#area[] have predefined area for each page from page number 2
for i in range(2, str(len(table_file))):
   j = i-2
   convert_into(table_file, output_csv, output_format='csv', lattice=False, stream=True, area=area[j], pages=i)
dataninsight
  • 1,069
  • 6
  • 13