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.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: xlsx-split-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 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.0.tar.gz
Algorithm Hash digest
SHA256 bf6218f9e91e1c33929fbba84f48f5703ae45d3030725c9941d41099d25abe9d
MD5 faad9ee60dc53ceda920ad4ecb989918
BLAKE2b-256 2ec2e291c5f7362edee7e22c9d263759482d2d641fbef45ddb2794c753cd1e76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xlsx_split-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 027a67036fbe89e60b8a6946f4d5c307b90f5c58f28cf3e78a7794de4c49bd29
MD5 3aa393a011e260690254bb2f5b8fb7f5
BLAKE2b-256 23119f4f214c1e50dd03eb5f7ef0935a488d2c4b32206d6b38e5d8e79c767db9

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