sqlite - sqlite3 output with tabs from one line command -


i want have sqlite3 output separated tabs. -column option not suit me because separate records spaces , values have spaces no tabs.

if use interactively sqlite3 can use .mode tab. one-line command has option -separator don't know how add tab there gets interpreted tab not literal (probably , ascii code?)

any suggestions? google examples found interactive sqlite3.

at moment using brute force approach:

sqlite3 -header mydb "select * table1" | tr \| '\t' > myoutput 

this should work:

sqlite3 -separator $'\t' -header mydb "select * table1" 

the $ tells shell expand tab character.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -