dinedal / textql

Execute SQL against structured text like CSV or TSV
MIT License
9.05k stars 300 forks source link

Creating (temp) tables adds blank lines to the output #85

Closed rdimartino closed 6 years ago

rdimartino commented 6 years ago

Running a multi-query string that creates tables adds an extra blank row to output for each created table. These blank rows are included in the -output-file too.

Examples:

$ textql -output-header -sql "create temp table one(word text); create temp table two(id integer); select *;" <(printf "a,1\nb,2\nc,3")

c0,c1
a,1
b,2
c,3
$ textql -pretty -sql "create temp table one(word text); create temp table two(id integer); select *;" <(printf "a,1\nb,2\nc,3")
+
+
+
+
+---+---+
| a | 1 |
| b | 2 |
| c | 3 |
+---+---+