From time to time there are questions about extracting data from CSV.
One approach is to apply a standard SQL query (simple structure, easily learned) to the CSV data, using sqlite3
which is a built-in macOS command line tool, and requires no installation.
Simple querying of CSV with sqlite3.kmmacros (2.7 KB)
Expand disclosure triangle to view sqlite3 shell Source
sqlite3 <<"EOF"
.mode csv
.import '| echo "$KMVAR_sampleCSV"' csvTable
SELECT clientid, weekdays, prices FROM csvTable WHERE up IS "True";
EOF