Tabula-py - 页面参数
Tabula-py - pages argument
tabula.convert_into(filename_final, (filename_zero + '.csv'),
output_format="csv", pages="all")
我将如何只转换第 2 页到最后? "area" 更改为从第 1 页到其余页面的转换。
我正在使用 Python 包装器 tabula-py
提前致谢!
根据README,页面参数可以是:
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
所以我想你可以试试 '2-99999'
。
Tabula-py - 页面参数
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)
tabula.convert_into(filename_final, (filename_zero + '.csv'),
output_format="csv", pages="all")
我将如何只转换第 2 页到最后? "area" 更改为从第 1 页到其余页面的转换。
我正在使用 Python 包装器 tabula-py
提前致谢!
根据README,页面参数可以是:
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
所以我想你可以试试 '2-99999'
。
Tabula-py - 页面参数
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)