如何正确格式化sqlite shell输出?
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;
本文来自博客园,作者:易先讯,转载请注明原文链接:https://www.cnblogs.com/gongxianjin/p/17525613.html