Start the sqlite3 program by typing "sqlite3" at the command prompt, optionally followed by the name the file that holds the SQLite database (or ZIP archive). If the named file does not exist, a new database file with the given name will be created automatically.
Ctrl + D will get you out of the SQLite 3 database command prompt. That is: hold the "Ctrl" button then press the lowercase d key on your keyboard at the same time and you will escape the SQLite 3 command prompt.
SQLite SELECT statement is used to fetch the data from a SQLite database table which returns data in the form of a result table.
I want to have my sqlite3 output separated by tabs. The -column option does not suit me because separate records with spaces and my values have spaces but no tabs.
If I use interactively sqlite3 I can use .mode tab
. The one-line command has the option -separator but I don't know how to add a tab there that gets interpreted as a tab not literal (probably with and ASCII code?)
Any suggestions? All the google examples that I found was for interactive sqlite3.
At the moment I am using the brute force approach:
sqlite3 -header mydb "select * from table1" | tr \| '\t' > myoutput
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