Page 1 of 1

ReadDelimitedFile Exception with Quoted Headers

Posted: March 7th, 2022, 5:25 pm
by msweeney
In CSV files, the values are often wrapped in quotes, like:
"data1", "data2", "data3"
"data4", "data5", "data6"
If the first row of a CSV contains headers, the ReadDelimitedFile service can use the values from the first row as element names instead of including them with the data, provided that HasHeaders is True. E.g.
<data1>data4</data1>
<data2>data5</data2>
<data3>data6</data3>
However, if HasHeaders is True and the values in the CSV's first row are wrapped in quotes, ReadDelimitedFile throws a System.Xml.XmlException "The '"' character, hexadecimal value 0x22, cannot be included in a name."

It would be nice if ReadDelimitedFile with HasHeaders=True could apply the first row as names even when the values are wrapped in quotes. On that note, it would probably make sense for it to entirely filter out quotes from the headers, as well as other characters that cannot be used in XML element names, such as parentheses, angle brackets, and spaces.

Re: ReadDelimitedFile Exception with Quoted Headers

Posted: March 8th, 2022, 11:56 am
by SteveCap
Task #10218 have been created and this post will be updated when it is completed.

Re: ReadDelimitedFile Exception with Quoted Headers

Posted: March 21st, 2022, 2:51 pm
by JustinVanRegenmorter
This issue has been resolved as of RunTime revision 906.