The count
command returns the number of rows of a CSV file.
It will not include the header row in the returned count, unless you provide the -n/--no-headers
flag.
So, given this particular file:
people.csv
name | surname |
---|---|
John | Black |
Lucy | Red |
Guillaume | Orange |
The following command:
xan count people.csv
Will return 3
.
Given this file:
people.csv
John | Black |
Lucy | Red |
Guillaume | Orange |
The following command:
xan count -n people.csv
Will return 3
.
Note that this is not always identical to the simpler:
wc -l people.csv
because the xan count
command is of course CSV-aware and will be able to tolerate properly escaped newlines within cell values.