最新消息:

q – Text as Data

工具 admin 1786浏览 0评论

q is a command line tool that allows direct execution of SQL-like queries on CSVs/TSVs (and any other tabular text files).

q treats ordinary files as database tables, and supports all SQL constructs, such as WHERE, GROUP BY, JOINs etc. It supports automatic column name and column type detection, and provides full support for multiple encodings.

q "SELECT COUNT(*) FROM ./clicks_file.csv WHERE c3 > 32.3"
ps -ef | q -H "SELECT UID,COUNT(*) cnt FROM - GROUP BY UID ORDER BY cnt DESC LIMIT 3"

 

Look at the examples page for some more examples, or just download the tool using the links above or in the installation page and play with it.

 

完全支持所有的字符编码 すべての文字エンコーディングを完全にサポート
모든 문자 인코딩이 완벽하게 지원됩니다 все кодировки символов полностью поддерживаются

Non-english users: q fully supports all types of encoding. Use “-e data-encoding” to set the input data encoding, “-Q query-encoding” to set the query encoding, and use “-E output-encoding” to set the output encoding. Sensible defaults are in place for all three parameters. Please contact me if you encounter any issues and I’d be glad to help.

官网:http://harelba.github.io/q/index.html

ps:q工具是一个可以对CSVs/TSVs文件进行SQL查询的工具。试用如下:

使用phpmyadmin将数据表导出成csv文件后尝试使用q工具进行文件查询。

QQ截图20141024143829

QQ截图20141024143844

转载请注明:jinglingshu的博客 » q – Text as Data

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址