I need to use a single command line to fetch a set of records from a database. If I do this:
$ sqlite3 con.db "SELECT name,cell,email FROM contacts"
I get output with a separator "|", where the output looks like this:
Alison|+12345678|alison@mail.com
Ben|+23456789|ben@mail.com
Steve|+34567890|steve@mail.com
Is there a way (in single command line format like specified above) to change the output field separator to something else, like ";;;" or something else or more unique. This is because the output occasionally get the character "|" inside the records, and it causes issues.
My desired result is:
Alison;;;+12345678;;;alison@mail.com
Ben;;;+23456789;;;ben@mail.com
Steve;;;+34567890;;;steve@mail.com
Or any other unique separator, which is not likely to be found inside the values.
(The command is executed on a Linux machine)
Thank you.