I would like to read a CSV file from the shell as if it was an SQL Database table.
Is this possible without having to import the CSV file content to a SQL enviroment? Maybe there is some kind of linux based tool that can work it out...
I know it sounds like a tricky question, but I'm trying to avoid installing a SQL server and stuff. I have some limitations.
Any clue?
Take a look at https://github.com/harelba/q, a Python tool for treating text as a database. By default it uses spaces to delimit fields, but the -d ,
parameter will allow it to process CSV files.
Alternatively you can import the CSV file into SQLite and then run SQL commands against it. This is scriptable, with a bit of effort.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With