【问题标题】:Tabula-py - pages argumentTabula-py - pages 参数
【发布时间】:2017-06-14 13:03:34
【问题描述】:
tabula.convert_into(filename_final, (filename_zero + '.csv'), 
                    output_format="csv", pages="all")

我将如何只转换第 2 页到最后?从第 1 页到其余页面的转换的“区域”会发生变化。

我正在使用 Python 包装器 tabula-py

提前致谢!

【问题讨论】:

    标签: python csv tabula


    【解决方案1】:

    根据README,pages 参数可以是:

    页面(str、int、int 列表、可选)
    - 一个可选值,指定要从中提取的页面。
    - 它允许 str、int、int 列表。

    示例:1、“1-2,3”、“全部”或 [1,2]。默认为 1

    所以我想你可以试试'2-99999'

    【讨论】:

      【解决方案2】:

      Tabula-py - pages 参数

      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)
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-12-04
        • 1970-01-01
        • 1970-01-01
        • 2019-02-28
        • 1970-01-01
        • 1970-01-01
        • 2019-01-10
        • 1970-01-01
        相关资源
        最近更新 更多