Skip to main content

count

The count command counts the number of rows in a CSV file.

Syntax​

qsv count [<input_file>]

Description​

The count command counts the number of rows in a CSV file.

Options​

  • None specific to count

Exit Codes​

  • 0: Count was successful
  • Non-zero: An error occurred

Examples​

Basic Usage​

Count the rows in a CSV file:

qsv count DLD_Transactions_English_500.csv

Output:

500

Counting Filtered Data​

You can combine count with other commands to count specific subsets of your data:

qsv search 'United States' DLD_Transactions_English_500.csv | qsv count

Common Use Cases​

  • Quickly checking the size of a dataset
  • Verifying the number of rows after filtering or transforming data
  • Counting occurrences of specific values when combined with other commands

Tips​

  • Remember that count includes the header row in CSV files
  • Use count in scripts to validate data processing steps

See Also​

  • search - for filtering rows based on a search term
  • select - for selecting specific columns before counting