Split CSV files without a spreadsheet
Upload limits in import tools, attachment size limits and very long exports are the usual reasons to split CSV files. Opening a large file in a spreadsheet only to copy blocks of rows by hand is slow and easy to get wrong. This splitter reads the file once, shows you exactly which files it will create, and keeps the header row in every one of them. Everything runs in your browser, so the data is not uploaded.
Three ways to split
Every N rows
Set the number of data rows per file. A file with 2,500 data rows split every 1,000 rows gives three files with 1,000, 1,000 and 500 rows. Files are named after the source, such as orders-part-1.csv; when there are ten or more parts the numbers are zero-padded (orders-part-01.csv) so they sort correctly.
Into N equal files
Set how many files you want, and the rows are shared out as evenly as possible: 1,001 rows into 4 files gives 251, 250, 250 and 250 rows. Row order is kept, so the first file holds the first rows. If you ask for more files than there are rows, each row gets its own file.
By the values of a column
Pick a column, and every distinct value gets its own file in the order the values first appear: all “North” rows in orders-North.csv, all “South East” rows in orders-South_East.csv. Characters that are unsafe in file names become underscores, an empty value goes to …-empty.csv, and values that differ only in case (“North” and “north”) get separate files with a number added, because some systems treat file names case-insensitively. A column can produce up to 1,000 files.
The header row in every part
With First row is a header ticked, the header is copied to the top of each file, so every part can be imported on its own. Untick it for files without a header; then every row counts as data.
Example
order_id,region,total
1001,North,120.50
1002,South,89.99
1003,North,42.00Split by the region column, this gives data-North.csv with the header and orders 1001 and 1003, and data-South.csv with the header and order 1002.
What the output looks like
- Fields that contain the delimiter, quotes or line breaks are quoted, so a quoted value with a line break is never cut in the middle.
- Lines end with CRLF, the CSV standard line ending.
- The output delimiter matches the input by default; you can switch to comma, semicolon, tab or pipe.
- Tick Add UTF-8 BOM if the parts will be opened in Excel and contain accented letters.
Each part's row count and size is listed before you download, so you can check that every file is under the limit you are working with. To put parts back together later, use Merge CSV. To look at a single part as a table, open it in the CSV viewer, and if your data is in a workbook, convert it with Excel to CSV first.