Live data from Hacker News

Q: Run SQL Directly on CSV Files

harelba.github.io

1–10 of 102 posts

Re: Q: Run SQL Directly on CSV Files

#4

I've never heard of this before, but it reminded me of this other command line tool for wrangling csv files in a cli. This tool makes use of SQL syntax much more than xsv, so there isn't 100% overlap here. https://github.com/BurntSushi/xsv

Thanks! xsv is new to me. I love Andrew Gallant's ripgrep(rg) grepping cmd tool.

Re: Q: Run SQL Directly on CSV Files

#6
Real-world CSV files generally contain some or all of the following horrors:

- some strings enclosed in speechmarks, but some not

- empty fields

- speechmarks within strings

- commas within strings

- carriage returns within strings

How does Q do up against a CSV file with those traits?

Re: Q: Run SQL Directly on CSV Files

#7
> Have you ever stared at a text file on the screen, hoping it would have been a database so you could ask anything you want about it?

Not really. I could see this being helpful for debugging, but at that point you can get by with some simple bash string operations. Doing that same operation w/SQL seems like overkill.

Post reply on HN