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
0
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.
I think you can do it like this:
Sorry, I see now that you were asking about Windows.
Here is how you can do it there:
First, switch off the "tab" auto complete:
Now I can use the TAB key as a value for the delimiter:
Note that [tab] was me actually hitting the tab key...
Or you can create a variable that hold the tab:
Again, [tab] was me actually hitting the tab key...
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]"
After seven years there is still no way to pass the separator in the windows command-line?..
A workaround example: Create the following "test.sql" file:
\pset fieldsep '\t'
select * from nodes;
Then run: .\vsql.exe -h 192.168.1.1 -U dbadmin -w password -Atf .\test.sql