Sorry for the late response. Yes, if you want to force the first
column to not have text qualifiers when the first column is empty,
then you'd have to turn off the text qualifier setting. This is
somewhat of a hidden "feature" in the component put there on purpose.
A lot of csv implementations will ignore blank lines, including
CsvReader depending on the setting. If there's a record with only one
column on it, and that column is empty, it's hard to differentiate a
blank line from a single empty cell, so in that case CsvWriter will
quote the first cell. And since it doesn't know at that time whether
there will be more than just the one cell on the line, this happens on
records with more than one cell on a line. The main rule in csv is
that text qualifiers, or the lack of, should never mean anything other
than specifying the escape sequence, so whether the first cell does or
doesn't have text qualifiers shouldn't matter. I have seen reasonably
high profile implementations like sql server however that export nulls
as non qualified and empty strings as qualified, but this is in no way
recommended for your own implementation. Sorry for the confusion, but
as you can see, it's a reasonably hard to explain feature.
Bruce Dunwiddie
On May 8, 4:44 am, SW <
stephenwinstan...@asprey-solutions.co.uk>
wrote: