Every branch gets its own file

DataFileSplitter » Use cases » One file per branch

Download DataFileSplitter Free Trial »     Buy DataFileSplitter Now »

The situation

The report exports everything into one file: every branch, every region, every sales rep, every customer - one CSV, and it is 2 GB. What each of them actually needs is their own file: the region manager wants the region's rows, the rep wants the rep's.

Filtering the file once per value by hand works until there are a hundred values, and it is the kind of job that gets done slightly differently every time - a row missed here, a file named differently there.

What you do

  1. Choose the file (CSV, TSV, TXT, Excel, JSON, JSONL, XML or SQL) and the column to split on - branch, region, rep_id, whatever it is called.
  2. Run the split. Every distinct value in that column becomes its own output file, named after the value.
  3. Send each file to the person it belongs to.

Splitting a CSV file by the values of a column with DataFileSplitter

Two things make this practical on a real export. The file does not have to be sorted first - a branch whose rows are scattered through the file still ends up in one output file. And the split happens on the records inside the file, so every output row is still a valid row and the header is handled for you.

What it will not do

Related

Splitting by value: split by column value, split JSON by column value, split XML by column value. Splitting by count instead: split by record count. In the browser: split CSV, split JSON.