Yes, csvtool (part of the csvkit suite) allows you to filter rows based on column values. The most common tool for this purpose is csvgrep, which lets you search for specific values in a CSV file and output matching rows.
csvgrepTo filter rows where a specific column matches a given value, use the following syntax:
bashcsvgrep -c <column_name> -m <value> <input_file.csv>
If you have a CSV file data.csv with a column status and want to filter rows where status is "active":
bashcsvgrep -c status -m "active" data.csv
-c <column_name>: Specify the column to filter on.-m <value>: Match rows where the column value equals <value>.-i: Case-insensitive matching.-v: Invert the match (exclude rows with the specified value).csvcut and grepIf you need more complex filtering, you can combine csvcut (to extract a column) with grep:
bashcsvcut -c <column_name> <input_file.csv> | grep "<value>"
But this only outputs the matching column, not the entire row. To get the full row, use csvgrep as shown above.
Would you like help with a specific filtering task or CSV file?
Vibe can make mistakes. Check answers. Learn more