Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

tab delimited output with vsql on windows ?

This is driving me nuts today. How do you set the delimiter to tab when spooling out to a file with vsql on windows ? I've tried giving all sorts of values to the -F option but can't get it to work. vsql is interpreting the what I give as literals e.g. if I give -F /t it makes the delimiter in the outout /t, -F '/t' makes it '/t' and -F E'\t'.
Any clue ?
Thanks
Dave

Comments

  • Hi. I don't know if this will help, and I recently spoke with the team that works on vSQL. Some of the behavior of vSQL is determined by the tecla library (see http://www.astro.caltech.edu/~mcs/tecla/) Take a look and see if it helps. I'd love to know what you find out. Additionally, perhaps there's a different answer regarding the behavior you're experiencing. I can ask, if you like.

  • Jim_KnicelyJim_Knicely Administrator

    I think you can do it like this:

    [[email protected] ~]$ vsql -Atc "SELECT * FROM jim;"
    val1|val2
    
    [[email protected] ~]$ vsql -F $'\t' -Atc "SELECT * FROM jim;"
    val1    val2
    
  • Jim_KnicelyJim_Knicely Administrator
    edited July 2017

    Sorry, I see now that you were asking about Windows.

    Here is how you can do it there:

    C:\Program Files\Vertica Systems\VSQL64>vsql -h verticademos.com -U dbadmin -Atc "select * from jim;"
    val1|val2
    

    First, switch off the "tab" auto complete:

    C:\Program Files\Vertica Systems\VSQL64>cmd /f
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    

    Now I can use the TAB key as a value for the delimiter:

    C:\Program Files\Vertica Systems\VSQL64>vsql -F "[tab]" -h verticademos.com -U dbadmin -Atc "select * from jim;"
    val1    val2
    

    Note that [tab] was me actually hitting the tab key...

    Or you can create a variable that hold the tab:

    C:\Program Files\Vertica Systems\VSQL64>set tab=[tab]
    
    C:\Program Files\Vertica Systems\VSQL64>vsql -F "%tab%" -h verticademos.com -U dbadmin -Atc "select * from jim;"
    val1    val2
    

    Again, [tab] was me actually hitting the tab key...

  • edited September 2017

    I found that the order in the command line makes a difference. I'm on Win 7 64-bit/VSQL64 8.1 and had to move the -F "[tab]" to the end of the line to keep vsql/Windows from complaining and ignoring everything in the line after the -F "[tab]"

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.