2016/08/05



 Twitter q

GitHub - harelba/q: q - Run SQL directly on CSV or TSV files

Text as Data q is a command line tool that allows direct execution of SQL-like q...
https://github.com/harelba/q

 SQL  python Goq

GitHub - mattn/qq

Select stdin with query
https://github.com/mattn/qq

 msys2  ps
$ ps
      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
     4876    2000    4876      13840  pty1     1061251 18:31:09 /usr/bin/ps
     2000   11384    2000       8804  pty1     1061251 18:30:45 /usr/bin/bash
    11384       1   11384      11384  ?        1061251 18:30:45 /usr/bin/mintty
     7552   13692   13692       9428  pty0     1061251 17:51:39 /usr/bin/ssh
    13692   12148   13692      18360  pty0     1061251 17:51:39 /usr/bin/ssh
     7828       1    7828       7828  ?        1061251 16:11:41 /usr/bin/ssh-agent
    12148       1   12148      12148  ?        1061251 17:51:39 /usr/bin/mintty

qq
$ ps | qq -q 'select pid from stdin'
2000
11384
9596
7552
13692
7828
12148

 SQL 

q
aaa bb
a b 

 aaa  a b  bb  q
$ cat nihongo.txt | q -H 'select bb from -'
b

 bb bqq
$ cat nihongo.txt | qq -q 'select bb from stdin'


 qqqqqq-ip 
$ cat nihongo.txt | qq -ip '\s+' -q 'select bb from stdin'
b

b -ic  CSV ()-it  TSV  -e  Windows  Excel  CSV 
,
,120
,100
,180
$ cat meisai.csv | qq -ic -e cp932 -q "select  from stdin where  = ''"
120
 CSV -oh -oj  JSON 使 -or  raw  $ ps | qq -q "select pid from stdin where command = '/usr/bin/grep'" | xargs kill

 awk  grep 使 golang 1python SQL  grep 

q golang 便使

後で引数からファイルを取ってunionとか出来る様にする予定なので、その場合は標準入力と区別するために - を採用する予定です。その場合、実行方法が上記の記事と異なる可能性があります。

Posted at by | Edit