I wear a lot of hats, and I up using CSVs pretty frequently because it's such a common layperson data exchange format. I know a bit of SQL, and I've caught myself wondering a thousand times why there aren't many tools for running SQL against a spreadsheet.
I was doing a little sysadmin today and caught myself wondering the same thing again. This time, though... I took a minute to wrap my head around it.
And now I know: Sqlite
What I found was how dead. stinking. simple it is to translate a csv directly to a sqlite database. From there, I could go to town on it.
Find a csv and tidy-up if needed. (caveat: all your columns need a header - makes sense for a database, though, right?)
Import the csv into a clean database
.import my_csv_file.csv some_db_name
Done! Sqlite automagically shuffled your spreadsheet into a new database. Run SQL against it, build a CLI app that consumes it, whatever - have fun!