sqlite> .mode column sqlite> select * from foo; 234 kshitiz dba.se
sqlite> .headers on
sqlite> select * from foo;
bar baz baf
---------- ---------- ----------
234 kshitiz dba.se
echo -e'.mode column \ n.headers on \ nselect * from sip_foo; \ n'| sqlite3 database.sqlite | less -S
sqlite3 database.sqlite -cmd“ .mode column” -cmd“ .headers on”“从sip_foo中选择*” |少-S
.mode column .headers on .separator ROW "\n" .nullvalue NULL
sqlite3 <dbfile> ".headers on;.mode column;select * from MyTable"
sqlite3 -column -header <dbfile> "select * from MyTable"
.mode columns
.headers on
CREATE TABLE my_table (name TEXT, age INTEGER, address TEXT);
INSERT INTO my_table VALUES ("short name",
22, "my house");
INSERT INTO my_table VALUES ("my name is very long",
22, "i live in my house somewhere in the planet Earth");
SELECT name AS "name ",
age,
address AS "address "
FROM my_table;
标签:sqlite,shell,格式化,name,column,headers,mode,my
From: https://www.cnblogs.com/gongxianjin/p/17525613.html