Skip to main content

Use \t as separator on command line.

  • June 13, 2013
  • 2 replies
  • 14 views

nick_ursa
How can I force a tab character as a field separator on the command line. I've tried vsql -t -F"\t", -f"\\t" and some variations on E'\09' etc. I have usually just piped to tr to get the job done but I feel there must be a better way. Thx. (sorry if repost, cannot find in FAQ)

2 replies

Forum|alt.badge.img+2
  • Participating Frequently
  • June 14, 2013
vsql takes the literal argument that is passed to it; if you want a tab, you'll have to get your shell to insert a literal tab. How to do this varies from shell to shell. One solution is to type a literal tab into a text editor, and copy/paste it into your shell. If you're using a bash shell, vsql -F $'\t' (with the leading '$') should do it.

grazia_d_aversa
That worked for me.
Thanks!