Using XSV on CSV files


xsv is a great tool for working with CSV files. There are just a few useful commands.

To get all the values for a single column:

xsv frequency --select ColHeader

To get all rows with a particular set of values (Note that it is a regex, not a conditional):

xsv search --select startDate "2023-0(3|(2-2[3-9])).*" .csv

To get just the first row (ideal for a quick test):

xsv slice --end 2 datq.csv

Date: 2023-04-04

Tags:  bash

Share: