How do I format table output in sqlite? For example, if the default behavior for showing entries is hard to read when one of the columns has variable length text. If I do select a,b,c from table
I get
a1|b1|c1
a2|b2|c2
while I want some nicer and easily readible formatting like..
++++++++++++++++
| a1 | b1 | c1 |
| a2 | b2 | c2 |
++++++++++++++++
For sqlite3 you just need a command
.mode table
and your tables should look like this:
+----------+-----------+
| per_id | per2_id |
+----------+-----------+
| 13449958 | 5135490 |
| 21085892 | 5135490 |
| 3291872 | 5135490 |
+----------+-----------+
In the case you want this to be permanent change, you need to write the same command .mode table
in the file called .sqliterc (if it doesn't exist just make one) in your home directory.
And that should do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With