Menu
Data & tables / csvkit

Check a spreadsheet handoff before opening Excel

Use csvstat to distinguish row counts, missing cells and identifier formatting in a tiny practice roster.

What stands out in csvkit

A spreadsheet application can reinterpret values as soon as you open an export. csvkit gives you a useful pause between receiving a file and editing it. Its column statistics help answer a narrow question first. Did the file arrive with the number of rows and kinds of values the sender described?

Walkthrough

  1. Download market.csv. Run csvstat --count market.csv to count records. A header and five registrations should produce a count of five. Counting physical lines instead can give the wrong answer in other files when a quoted comment contains a line break.
  2. Run csvstat -c status market.csv and read the distinct values and their frequencies. The expected distribution is four confirmed registrations and one pending. If the distribution differs, check the original strings before treating the report as an event summary.
  3. Inspect the ticket column with csvstat -I -c ticket market.csv. The -I switch disables type inference. Compare the identifiers with the first column in the raw file. Here 001 identifies a ticket. It is not a number you will average or sum.
  4. Give the recipient a compact handoff note containing the file name, row count and status distribution. Record that the ticket field should be imported as text. That detail matters more than a long dump of statistics when the recipient's next step is printing badges.

Field tip

Use the smallest report that answers the question. A count is quick to read. A full profile can bury a missing identifier among dozens of useful but irrelevant statistics. Profile one suspicious column before generating a report for every field.

Where it falls short

Repeated values require context. A repeated booth is meaningful when a business registered twice. A repeated ticket would raise a different question. Statistics expose the pattern, while the event rules determine which repetitions deserve a correction.

Try it yourself

Create a second copy with the last registration removed. The record count falls to four, but the status column still contains two distinct words. Seeing the same set of labels in both files does not prove the handoff is complete.

Download practice file · CSV ↓

Product documentation

csvkit official reference ↗

Where to go next