On Thu, Oct 13, 2016 at 2:42 PM, Don V Nielsen <donvniel...@gmail.com>

> Thanks, but it appears that ".mode column" triggers it, and .separator does
> not appear to have any influence in that mode.
> Out of curiosity, it appears that the row separator (in windows) is a
> single character. Do you know to specify as the row separator?  Everything
> I attempt is taken as literal characters.  I've attempted: 0x0D0x0A,
> 0x0D0A, 0Dx0Ax. Nothing appears to work.

​The row separator is specified using the 2nd parameter of the .separator
command. Example transcript:

SQLite version 3.11.0 2016-02-15 17:29:24
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .mode column
sqlite> .separator | -
sqlite> create table a(one text,two text);
sqlite> .width 10 10
sqlite> insert into a values('1a','2a');
sqlite> insert into a values('1b','2b');
sqlite> select * from a;
1a          2a        -1b          2b        -sqlite>

Note that the specified column separator is ignored in .mode column, but
the row separator is not. Also, for fun, note what happens with negative

sqlite> .width -10 -10
sqlite> select * from a;
        1a          2a-        1b          2b-sqlite>

Also, I have looked at the current sqlite3.c source code. In .mode column,
the space separator character is "hard coded" and so cannot be set to any
other character.​

Lastly, you can specify a "control" character by using a C language escape.
E.g. (continuing from above examples)

sqlite> .separator - \n
sqlite> select * from a;
        1a          2a
        1b          2b

To address your desire, it would be necessary for the column separator
character to be honored in .mode column mode and the separator be made a
0x00, or \0. If Dr. Hipp were to do this, this would eliminate the column
separator entirely because \0 would result in "no" character between the
columns. This appears, to me, to be a rather simple change in shell.c.

> dvn

Heisenberg may have been here.

Unicode: http://xkcd.com/1726/

Maranatha! <><
John McKown
sqlite-users mailing list

Reply via email to