[This topic is migrated from our old forums. The original author name has been removed]
Apologies if this question has been answered. I've searched the forum and other places and haven't found the answer.
Is there a way to set the delimiter when outputting to a csv file using the command line interface?
I'm trying to run queries and output the results using a combination of a batch file, the command line interface and windows task scheduler. Then I want to process these outputs using an Excel VBA macro, using a different batch file and scheduled task.
Each stage is working ok in itself, however the problem I am having is that the csv file isn't delimited so my 'text to columns' line in the VBA doesn't have the desired effect. I can't use space as a delimiter as one of my extracts contains a name field.
I've spent a good couple of hours on this now and don't seem to be getting anywhere, so any help would be much appreciated.
Assuming you are using the @export command, you can set the column delimiter with:
@export set CsvColumnDelimiter="
All @export options are described here:
about 4 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: Controlling Output from a .bat file
I was initially using the -output command in the batch file, but changing to @export in the sql works much better.