PDA

View Full Version : SQL engine for text files



kung foo man
17th November 2015, 00:01
Found some nice project: https://fedorahosted.org/squeal/

There are many examples on front page, just gotta copy/paste one:



$ squeal "count(*)", source from /var/log/messages* group by source order by "count(*)" desc
count(*)|source |
--------+--------------------+
1633 |kernel |
1324 |NetworkManager |
98 |ntpd |
70 |avahi-daemon |
63 |dhclient |
48 |setroubleshoot |
39 |dnsmasq |
29 |nm-system-settings |
27 |bluetoothd |
14 |/usr/sbin/gpm |
13 |acpid |
10 |init |
9 |pcscd |
9 |pulseaudio |
6 |gnome-keyring-ask |
6 |gnome-keyring-daemon|
6 |gnome-session |
6 |rsyslogd |
5 |rpc.statd |
4 |vpnc |
3 |gdm-session-worker |
2 |auditd |
2 |console-kit-daemon |
2 |libvirtd |
2 |rpcbind |
1 |nm-dispatcher.action|
1 |restorecond |


This might be pretty useful/powerful when used on sound .csv files, CoD log files etc.


Edit: aaaand found a second SQL file engine, which is basically a very simple Python script, reusing SQLite via temp table, so it supports full blown SQL:


https://www.youtube.com/watch?v=Nxx2T0BOp3k

https://github.com/wishvamalli/doSQL