Count the rows in a CSV file

Open it in Numbers and the row numbers show at the side. In Terminal, wc -l counts the lines instantly, even in files too big to open — subtract one for the header.

How

Lines in the file (rows plus the header):

wc -l customers.csv

Just the data rows:

echo $(( $(wc -l < customers.csv) - 1 ))

A cell containing a line break makes one row span two lines, so the count can be slightly high.

Or just ask Titan
How many customers are in this CSV, and how many have no email? Do it with Titan

Titan is an AI that lives on your computer: tell it what you need and it does it while you watch — you press Return, nothing runs by itself. What is Titan?

Titan isn’t on this computer yet. Get Titan, then press the button again — the task will be waiting, typed in.

Related

Count the words in a documentCount the files in a folder