onyxfish/csvkit — Issue #135: Possible new feature - csvuniq -c
Author: glepore70
Created: 2012-01-06 14:59:28+00:00
State: open

I've been using csvkit for a few days to replicate some complicated Perl programming I have to examine tabular data. I think csvkit is great! One feature that I would like to see is the ability to emulate the UNIX uniq -c command. This would allow us to extract a column using csvcut, run it through csvuniq -c, sort it and get a list of the most used unique values in that column. Currently I'm using this:
./csvcut -d"|" -c 1 $file | uniq -c| ./csvsort -r | head -11
which basically works, but it appears that the csvkit tools are smart enough to identify the column header and not include it in results. Piping the column through UNIX uniq -c throws the column back into the mix and doesn't properly extract it as the header (I think.)

Please let me know if I'm missing something, thanks!

GL