3 ms·
> curl -s https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip | gunzip | sqlite3 ':memory:' '.import /dev/stdin stdin' "select Date from stdin order
by lovasoa 3y ago
> curl -s https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip | gunzip | sqlite3 ':memory:' '.import /dev/stdin stdin' "select Date from stdin order by USD asc limit 1;"
Error: in prepare, no such column: Date (1)
There is a typo in the example (that is not in the screenshot): you need to add a -csv argument to sqlite.
- calpaterson 3y agoThis is odd, I did originally have that argument but I removed it because it didn't seem to matter - it works without ("On My Machine"(tm)) Erk - readding it and busting the cache. After I put my kids to bed I will figure out what is wrong EDIT: the reason it works for me is because I've got this config in ~/.sqliterc: .separator ',' Apparently at some point in the past I realised that I mostly insert csv files into it and set that default.
- c7b 3y agoGenerally curious - any particular reasons you chose sqlite and gnuplot for this task rather than, say, Python?
- calpaterson 3y agoI do also use Python (pandas) partway down the page :) I'm just trying to show different tools to give people ideas about how much is possible with stuff that is already in /usr/bin/ If you were to ask my own tool preferences which I use for $DAYJOB: pandas for data cleaning and small data because I think that dataframes are genuinely a good API. I use SQL for larger datasets and I am not keen on matplotlib but still use it for graphs I have to show to other people.
- walth 3y agoShouting out that clickhouse-local can do all of those in one step, including downloading, parsing, SQL query and charting.