Live data from Hacker News

TextQL: Execute SQL Against CSV or TSV

github.com

21–30 of 95 posts

Re: TextQL: Execute SQL Against CSV or TSV

#21
post #5

In SQLite you can just do sqlite> .import myfile.csv mytable sqlite> select ... What does this tool give you that SQLite doesn't do out of the box?

As a command-line tool it could serve as a more powerful replacement for unix utilities that I often use for simple analysis jobs: sort, uniq, wc, awk, sometimes cut and sed. I'm going to give it a try.

It looks like textql loads everything into an in-memory SQLite instance, whereas I'd really like to see an approach that uses the SQLite's virtual table mechanism (https://sqlite.org/vtab.html), which would avoid the loading step and perhaps make streaming processing possible.

Re: TextQL: Execute SQL Against CSV or TSV

#22
I usually appreciate the animated gif screenshot (especially for curses based programs), but this particular animated gif would have been better off as just plain text—there's too much interesting data that can't be copied, it's real hard to go back to look at something that you missed and it's frustrating to have to wait while fake typing happens. I really wish there was just a transcript of the gif that I could read at my own pace.

Re: TextQL: Execute SQL Against CSV or TSV

#24
If you are on Windows you may consider using Log Parser Studio [1]. It is a GUI over logparser.exe which understands a lot of various file formats and uses SQL to query them [2].

[1] https://gallery.technet.microsoft.com/office/Log-Parser-Stud...

[2] https://en.m.wikipedia.org/wiki/Logparser

Re: TextQL: Execute SQL Against CSV or TSV

#27

Earlier quoted context omitted.

That's a silly complaint. It's a tool powered by SQLite. Under your extended definition, tools like web browsers (which use SQLite to power various things) would be SQLite wrappers.

I don't see it as a complaint but as a piece of feedback and if you're the author then you may want to revisit your attitude.

Nah, people say such ridiculous garbage that they need to be called out. Especially here where people seem to take delight in disparaging your work in the tiniest way they can think of.

I don't think OP needs to pussy foot around some stranger on an internet message board. It's free shit.

Re: TextQL: Execute SQL Against CSV or TSV

#28
post #17

PostgreSQL does this out of the box with : CREATE EXTENSION file_fdw; CREATE SERVER import FOREIGN DATA WRAPPER file_fdw; CREATE FOREIGN TABLE foo ( col1 text, col2 text, ... ) SERVER import OPTIONS ( filename '/path/to/foo.csv', format 'csv' ); SELECT col1 FROM foo WHERE col2='x';

However this is something you can put in /use/local/bin and use alongside other command line tools with pipes

Re: TextQL: Execute SQL Against CSV or TSV

#30
post #17

PostgreSQL does this out of the box with : CREATE EXTENSION file_fdw; CREATE SERVER import FOREIGN DATA WRAPPER file_fdw; CREATE FOREIGN TABLE foo ( col1 text, col2 text, ... ) SERVER import OPTIONS ( filename '/path/to/foo.csv', format 'csv' ); SELECT col1 FROM foo WHERE col2='x';

Which is exactly why a convenient alternative was desired.
Post reply on HN