SELECT

SELECT is an SQL interface to text files.
Download

SELECT Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Price:
  • FREE
  • Publisher Name:
  • Markus Bertheau
  • Publisher web site:
  • http://select.mbertheau.de/

SELECT Tags


SELECT Description

SELECT is an SQL interface to text files. SELECT is an SQL interface to text files:$ SELECT response_code, count(1) FROM access_log WHERE method = "'GET'" > GROUP BY response_code ORDER BY 2 DESCresponse_code | count(1) ---------------+---------- 200 | 157820 404 | 25138 304 | 17938 301 | 2348 302 | 1486 206 | 673 405 | 16 401 | 15 500 | 8 403 | 1 $ head -1 access_logpd90b3592.dip.t-dialin.net - - "GET / HTTP/1.1" 200 768 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)"SELECT currently specificially supports the NCSA extended/combined transfer log format (access_log), and all other text files generically. It is easily extensible to support other text file formats.SELECT is licensed under the GPL Version 3.InstallationSELECT requires Python and pysqlite2. Python 2.5 includes pysqlite2.Download and unpack the tarball and copy SELECT to a directory in your $PATH, for example /usr/local/bin:$ wget http://select.mbertheau.de/files/SELECT-0.1.tar.bz2$ tar xfj SELECT-0.1.tar.bz2$ sudo cp SELECT-0.1/SELECT /usr/local/binUsageSELECT FROM file fieldlist is a comma separated list of field names or the special keyword all, which is replaced by a star *. file is a file name or - to read from standard input. rest_sql may contain SQL clauses like WHERE, GROUP BY, HAVING, LIMIT, OFFSET and ORDER BY.How it worksSELECT at first tries to determine a file type a set of regular expressions. If that succeeds, speaking column names are available, and the lines are split into columns according to their semantics. If it didn't, they are named with numbers and split by white space. Then SELECT loads the data into an in-memory SQLite database, executes the query and outputs the results to stdout.


SELECT Related Software