1

I have started using CSVKIT and I have learned a lot about how to use it and ways to manipulate data, but I am still working to gain all the concepts. I was recently asked to produce a record count based on all unique values in a column. I understand that this can be accomplished using Excel, but I wanted to find something other than Excel and my needing to create a VBA script as I have to batch process it over multiple files.

using CSVKIT I have gotten the following:

CSVSTAT -c 1 -uniq test.csv > test_report.csv

This only tells me the number of unique values, but not their names and not the counts per each unique value. At one point I had the values but not the counts, but I am at a loss now. Anyone who can point me in the right direction would be much appreciated.

John D
  • 139
  • 13

1 Answers1

2

Use SQL, with csvsql

csvsql -I --query "select yourfield, count(*) as count from filename group by yourfield order by count DESC" filename.csv
aborruso
  • 4,938
  • 3
  • 23
  • 40