Queryfy Excel, Tables, CSV + more

Examples

Few examples to get you going.

Arithmetic operations on columns
Using a constant and a column value. SELECT model, shoesize, shoesize*1.42 from .. operations between one or more columns. The usual operator precedence applies. SELECT employeeName, sallary+bonus-parkingFee FROM..
Using an ALIAS for calculations
Using an lias is convenient when you need to rename or ..
aliases may only contain letters and digits (a-z, 0-9) and nothing else.
SELECT model, shoesize, shoesize*1.42 AS eurosize from ..
They are useful with ORDER BY, too.
SELECT country, gold+silver+bronze AS totalMedals from .. ORDER BY totalMedals
Using GROUP BY
Summarize product types and average price for each type.
SELECT type,avg(price) FROM 4ab6d05e5139a group by type
Now using COUNT, get product types and how many of each exist.
SELECT type,count(type) AS products FROM 4ab6d05e5139a GROUP BY type
Two more elaborate examples.
SELECT type,count(type) AS products,sum(price) AS value FROM 4ab6d05e5139a GROUP BY type SELECT type,count(type),max(price),min(price) AS cheapest from 4ab6d05e5139a ORDERN by cheapest GROUP BY type
Using extended regular expressions
SELECT * FROM 4ab6d05e5139a WHERE price like ^\d{1}\.\d ORDER BY name DESC
SELECT * FROM 4ab6d05e5139a WHERE price BETWEEN 3,10 AND type NOT EQUALS food SELECT name,price FROM 4ab6d05e5139a WHERE name LIKE ^\w{9,} ORDER BY price SELECT $1,$2,$4 FROM 4ab6d05e5139a where name like ^b|s$ AND price > 20
Psuedo SQL: This application uses a loose adaptation of the SQL language for processing text-based data. There is no database involved. This is the first incarnation and changes may be introduced at any stage.

Syntax Overview

SELECT *
Select all columns in document.
SELECT $1, $2..
Columns are named $1, $2, $3 and so on, these shortnames are exchangeable with column names.
SELECT columnname1, columnname2..
If you want to spell out the whole column name, thats fine, too.
SELECT FUNCTION1(..), FUNCTION2(..)..
Some aggregate, string and numeric functions are available. Referer to the list below.

You can use SELECT with a combination of the above.
This is a valid statement SELECT name,$4,sum($2),avg(bonus)...
FROM doc_id
doc_id is unique identifier for the current document.
WHERE columnname1 clause(s)
Returns only rows that match some certain condition(s)
A regular expression can be used as a pattern in conjuction with LIKE, STARTSWITH, and ENDSWITH. Per default, all matches are performed case-insensitive; both regex and literal strings will match letters by ignoring case. For example, Foo will match "Foo", "foo", or "FoO".
Two clauses must be delimited by either an AND or an OR.
The following operators can be used with WHERE:
LIKE string/regex
NOT LIKE string/regex
Specify whole or partial words to search for a pattern. Apart from the regex support, its behaviour is similar to SQL's LIKE operator.
STARTS WITH string/regex
ENDS WITH string/regex
These two are merely a shortcut for LIKE ^.. and LIKE ..$, so:
name LIKE ckson$ is exchangeable with name ENDS WITH ckson
Relational operators
  • Equality: any of EQUALS, EQ, == , =
  • Inequality: any of NOT EQUALS, NEQ, !=, <>
  • Comparison: You get the usual <= , < , >= , >
BETWEEN lower,upper
BETWEEN is a shorthand for the combination of the relational operators >= and <= to specify integer ranges. BETWEEN behaves strict: no spaces before or after the comma. As an example, to extract all employees between the age of 20 and 32, you would do: SELECT name,age FROM .. WHERE age BETWEEN 20,33 both numbers are inclusive.
ORDER BY column-name / $number / alias [ASC|DESC]
Returns a result set with the rows sorted (alpha) by the field identified by either column name or number. Use DESC for a descending order, or ASC for ascending (default)
ORDERN BY .. ...
To compare according to string numerical value (numeric sort) use ORDERN.
In both cases: The ordering column must be in your SELECT statement.
GROUP BY column-name / $number / alias
The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by exactly ONE column.
LIMIT number
Number of results returned.
ALIAS column AS foo
To change the name of a selected value, be it a column name, function or calculation, use an alias. An example with columns: SELECT nation,bronze+gold+silver AS total FROM ... ORDER BY total DESC You can use the resulting alias with ORDER BY, as seen above. Avoid using anything other than letters and digits in a alias.

Aggregate functions

All the following functions, except COUNT, assume column contains only numerical values, anything else is skipped. The decimal separator is a dot, as in 3.14, and not a comma. A thousands separator is not expected to appear: 3,000 should be 3000. If your columns are preformatted with a comma, despair not. You can remove it thru the options menu (consider replacing them beforehand, though, since this might be a bit slow.)
COUNT(*)
Returns the number of records that match your criteria, if any.
COUNT(column)
Pellentesque habitant morbi tris tique senectus et netus
SUM(column)
Return the sum of all the values in column.
MIN(column)
MIN finds the smallest value in the column named column.
MAX(column)
MAX finds the smallest value in the column named column.
AVG(column)
Returns the average value of column...arithmetic mean..

String functions

SUBSTR(column, start, maxlen)
Returns ..
LENGTH(column)
Returns the length of the column column
TOLOWER(column)
Converts content of column to lowercase. Non-alphabetic characters are left unchanged.
TOUPPER(column)
Converts content of column to uppercase.

Numerical functions

Few arithmetic functions are provided as well:
SQRT(column)
Returns the square root of column.
EXP(column)
The exponential function..
LOG(column)
Returns the natural logarithm column.
SIN(column)
Returns the sine of column, in radians.
COS(column)
Returns the cosine of column, in radians.

Regular expressions

This application supports the POSIX standard -- Extended Regular Expressions (EREs)
Most characters, including all letters and digits, are regular expressions that match themselves

Unless used with '^', '$' or '\b', a regular expression only needs to match some part of the text in order to succeed. For example, WHERE name LIKE ^Bob$ matches a column containing ONLY Bob, whereas WHERE name LIKE Bob matches Bob anywhere in the column: Bob, Bobsson, DjBobble, and so on.

Regular expressions are composed of characters as follows:
   c          matches the non-metacharacter c.
   \c         matches the literal character c.
   .          matches any single character including newline. Alternatives: % or *
   ^          matches the beginning of a string.
   $          matches the end of a string.
   [abc...]   character set: matches any of the characters abc....
   [^abc...]  complemented character set: matches any character except abc....
   a1|a2      alternation: matches either r1 or r2.
   a1a2       concatenation: matches r1, and then r2.

   (...)      Use parentheses for grouping to concatenate regular expressions
              containing the alternation operator, '|'. This regex
              WHERE name LIKE ^(P|S) matches all names that begin
              with either P or S.

Repetition

A regular expression may be followed by one of several repetition operators:
   a?      a is optional and matched at most once.
   a*      a will be matched zero or more times.
   a+      a will be matched one or more times.
   a{n}    a is matched exactly n times.
   a{n,}   a is matched n or more times.
   a{,m}   a is matched at most m times.
   a{n,m}  a is matched at least n times, but not more than m times.

Special Expressions

   \b      word boundary: used to perform a "whole words only" search.
           Given a name JOE JOHNSON, \bJOHNSON\b matches while \bJOHN\b doesn't.
   \d      digit: matches a single digit (0, 1, 2, ..9)
   \w      alphanumeric:matches any word-constituent character (letter, digit, _)
   \W      matches any character that is not the above.
   \s      whitespace (space, tab, etc.)

Special characters

   \.      matches a literal dot.
   \\      matches a literal backslash.
..dragons be here..

Documents accessed during this session:

Column names (and numbers)
foo
/bar
Document ()
Type
Size 0KB (0 bytes)
Records (#rows) 0
Columns pr. record
Column names
Submitted Dec 31, 1969 @ 16:12 PST
Document contains 0 fields ( rows x columns).
Copy/paste, download from an url or upload any of the following:
spreadsheets (Excel), HTML tables, CSV (and alikes)
Field seperator applies to text files only Data copied from spreadsheets
and HTML tables is almost always
delimeted by a single TAB
Data starts at line Skip content until this line,
where column names are expected..
Paste your content below: Copy/paste from spreadsheets, html tables, etc.
First line should contain the column names.
Field seperator applies to text files only Data copied from spreadsheets
and HTML tables is almost always
delimeted by a single TAB
Data starts at line Skip content until this line,
where column names are expected..
Choose a file pssst..mind the size limit!
Field seperator applies to text files only Data copied from spreadsheets
and HTML tables is almost always
delimeted by a single TAB
Data starts at line Skip content until this line,
where column names are expected..
Retrieve from URL full path to remote file.
Google spreadsheets are fine, too.
Maximum filesize: 500KB

What does it do?

The power of SQL

Use SQL-like syntax to reorganize, sort, group, summarize and generate reports out of large data sets.

Select this and that..

Use the power of regular expressions to pick 'n' choose and get rid of unwanted portions of any document.

Convert spreadsheets to HTML, database

Move data easily across platforms with SQL, CSV, EXCEL and ready-to-publish HTML export options.

Collect, manipulate, publish to web/database.. fast!

Take content from anywhere on the net, write queries on that dataset to generate particular views of the data.

What is it?

Perform quick in-and-out operations (like report generation, data reduction/extraction) on any delimited content or spreadsheet conveniently without fiddling with spreadsheet programs.

Import EXCEL spreadsheets or any delimiter-separated data, such as CSV, HTML, manipulate it quckly with SQL-like querying language and export it to various formats, including spreadsheet and database.

* Sample document from screencast is found here

Todo:


		Google:
			-	XML->CSV, HTML->CSV
			-	is_* returns string all the time

#		FIX THIS
		optional->	SELECT count(bronze),sum($2) FROM 4aab87af86b0e

		- ORDERN BY a-column-with-space FAILS.

		- Excel conventions:no line-breaks inside columns, delete tabs
		- if conversion goes awry, numrec==-1, show msg, activate import tab
		- Excel download broken in MSExcel (phpMyAdmin has solution?)
		- ..WHERE a-colname-with-a-space fails
		- CSV: replace COMMAs enclosed in quotes to DASHes with SED -i 's/..//g'
		- MAXDELTA($N),MINDELTA($N),AVGDELTA($N) => different between two adjacent (numeric) values in a column
		- use flash SharedObjects to remember documents accessed by user
		- AWK BROKEN - FIELDSEP values enclosed within double-quote characters not ignored
		- Google spreadsheets must be CCC licenced or in the public domain 
			(http://spreadsheets.google.com/ccc and http://spreadsheets.google.com/pub, respectively)
		- security concern: move the cache dir to output server_root

		- VERSION2
			- Subqueries: SELECT name,sallary,age from 4aafa669bd5cb where age == (select max(age) from 4aafa669bd5cb)
			- group by $5,$6
			- count(title,date) -> count[$1,$4]=$1,SUBSEP,$4..... end for loop -> n = split(item,arr,SUBSEP);
			- WHEN "Unknown field name", hilite the string within the textarea
			- autocomplete on textarea (jQuery)
			- Interactive mode with jQueryUI: drag and drop, group rules into boxes (AND/OR couples)