Skip to main content

Excel表格分割工具。

Project description

xlsx-split

Excel表格分割工具。将excel逐行拆分,每行另存为独立文件,支持表头、表尾的复制。

命令行说明

    E:\xlsx-split>xlsx-split --help
    Usage: xlsx-split [OPTIONS] WORKBOOK

    Options:
    -h, --header TEXT            Header row number list.
    -f, --footer TEXT            Footer row number list.
    -c, --cols TEXT              Column number list.
    -r, --rows TEXT              Content row number list.
    -t, --test TEXT              Conditions that a good row must matchs. Format
                                like COL_LETTER:REGEX, e.g. A:\d+ means the
                                value of A column must be an Integer.
    -s, --sheet TEXT             Sheet name. Default to Current Active Sheet
    -w, --workspace TEXT         Where new files saved. Default to
                                "{FILENAME_ROOT}"
    -p, --filename-pattern TEXT  Default to
                                "{FILENAME_ROOT}-{ROW}.{FILENAME_EXT}"
    --help                       Show this message and exit.

注意事项

  • header/footer/rows 都遵从row列表规则。
  • cols 遵从col列表规则。
  • test 遵从test规则。
  • filename-pattern遵从FILENAME规则。

row列表规则

  • 1 == [1]
  • 1,2,3 == [1,2,3]
  • 1-3 == [1,2,3]
  • 1-3,5 == [1,2,3,5]
  • 3- == [3,4,5,6....] # 从第3行开始,直到最后一行。

col列表规则

  • A == [1]
  • A,B,C == [1,2,3]
  • A-C == [1,2,3]
  • A-C,E == [1,2,3,5]
  • C- == [3,4,5,6....] # 第C列表开始,直到最后一列。

test规则

  • 每个test都是由(列名+":"+正则)组成,如(A:\d+)。
  • 可以由多个test组成。
  • 多个test求“与”为最后结果。

FILENAME规则

  • filename-pattern提供字符串模板。
  • 字符串模板变量有
    • FILEPATH 源文件全路径
    • DIRNAME 源文件所在目录
    • FILENAME 源文件名
    • FILENAME_ROOT 源文件名不带后缀
    • FILENAME_EXT 源文件后缀
    • ROW 当前数据行索引,如1,2,3...
    • A..Z,AA... 当前数据行指定列的单元格值(公式计算后的值)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xlsx-split-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

xlsx_split-0.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file xlsx-split-0.1.1.tar.gz.

File metadata

  • Download URL: xlsx-split-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for xlsx-split-0.1.1.tar.gz
Algorithm Hash digest
SHA256 463272d744e6a92beb5905d861f028b5205877d573da1f74657581ae1c77f93f
MD5 b9472861f3c5c725702da59c8bf6c16f
BLAKE2b-256 9ce4feb0c946bb7d1ef6e5de2c3791ebb1bf16ccae0bbe7f3546c30934d61563

See more details on using hashes here.

File details

Details for the file xlsx_split-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xlsx_split-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for xlsx_split-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a044943a493ada1bf4a84c3e607e65a0f2def657f1abff2dfdd450ca8fe3512
MD5 f5c2b69d4c0e99d634936307df05f309
BLAKE2b-256 0b77a5fb810946fd85e1cde085424e191d5e28389fdef0764b3ca8f9fbc8fcdc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page