$ sqlite3 $ .mode csv $ .import my.csv foo $ SELECT * FROM foo WHERE name = 'bar';
PS> gsudo choco install sqlite3 PS > sqlite3 sqlite> .mode csv sqlite> .separator ; \n sqlite> .import my.csv foo sqlite> SELECT * FROM foo WHERE name = 'bar';
Get-Content my.csv | ConvertFrom-Csv | ? name -eq bar
Another advantage is that this can be executed to import as part of initialization and get to sqlite prompt with the table ready for sql execution:
$ csv_to_table.sh sample-test.csv
$ csv_to_table.sh sample-test.csv <<-CMD select * from sample_test limit 10; CMD ... output ...
[0]: https://github.com/psanford/csv2sqlite
Aside from the fact that OP's example can run in a non-interactive mode, it makes absolutely no difference to the discussion.
If AP had a "better way of doing things" maybe they should have actually given us an example of what it looks like.
Right now, all I think about R is that snobby, gatekeeping assholes use it to do things I can already do easily in SQL.