Skip to main content

CSV-Split

Vertical splitting (columns)

Splits a given CSV file vertically. Accepts either a batch-size, or a split-pattern to create multiple files from a single files. All files will contain different columns of original csv. Order of columns will be maintained.

Horizontal splitting (rows)

Not supported yet

Usage

The below command will take large-file.csv and split it vertically into 3 files. First file will have 10 columns, 2nd file will have 5, and the 3rd will have 12. If there are more columns in the original file, they will be ignored.

csv-split -i ~/Downloads/large-file.csv -p 10,5,12

Instead of split-pattern, you can also specify batch size.

csv-split -i ~/Downloads/large-file.csv -b 7

By default, all the output files will be stored in a new directory called output. Generated file names will have index number appended. For example, large-file_1.csv, large-file_2.csv, ...

If you want to change the output directory, you can use -o option as shown below.

csv-split -i ~/Downloads/large-file.csv -b 10 -o ~/Downloads/splitted-data/

If this directory does not exist, it will be created.

This will create csv files and each csv file will contain 7 columns. Number of output files will depend on number of columns in input files.

Metadata

Release files for csv-split 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csv-split 0.1.2
File Size Uploaded
csv-split-0.1.2.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for csv-split 0.1.2
File Interpreter ABI Platform
csv_split-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / csv-split-0.1.2.tar.gz

Download URL csv-split-0.1.2.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b280ef280a521d0b840a3b31b585daf7c11ad50168d643ff0201f49d97ed2f96
BLAKE2b-256 checksum
How to use checksums
1e3782860ec9e2246f9b2f2632f51c24274085d736a60bc14a2cb3beaefbf68a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release files / csv_split-0.1.2-py3-none-any.whl

Download URL csv_split-0.1.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94c464b7ca3ba5a675f034d6d02639fc3a236eba08afa874be69fb54036861d0
BLAKE2b-256 checksum
How to use checksums
d882c8395a6e533aab6db242ccfb756586c50709c819afc56375d703084fe181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page