A lot of folks mentioning great projects/solutions that work the same but I love me some good unix piping action:
cat data.csv | xsv select 1,3 | q 'select * from - where col1 != "foo"'
(xsv: also invaluable on the terminal: https://github.com/BurntSushi/xsv)