How can I replace an underscore ("_") in a field with a tab?

I have a field in a sqlite3 table that looks similar to this:
a_1
b_2
c_3
...

I would like to replace the underscore with a tab not in the database
itself, but rather just in the output.  Unfortunately, this does not
work:

$ sqlite3 foobar.db 'select replace(id,"_",\t) from bar;'

This works but seems like suck a hack:

$ sqlite3 foobar.db 'select replace(id,"_","{tab}") from bar;' |
 sed -e 's/{tab}/\t/'

I was hoping for a char(9) or similar but couldn't find anything in the docs:

http://www.sqlite.org/lang_corefunc.html

Pointers to references greatly appreciated.

Regards,
- Robert

--~--~---------~--~----~------------~-------~--~----~
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
More options: http://groups.google.com/group/cwelug
-~----------~----~----~----~------~----~------~--~---

Reply via email to