ReadDelimitedFile Exception with Quoted Headers

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
Post Reply
msweeney
Posts: 6
Joined: February 28th, 2022, 12:13 pm
Contact:

ReadDelimitedFile Exception with Quoted Headers

Unread post 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.
word count: 160

Tags:
SteveCap
Posts: 328
Joined: August 26th, 2021, 9:18 am
Contact:

Re: ReadDelimitedFile Exception with Quoted Headers

Unread post by SteveCap »

Task #10218 have been created and this post will be updated when it is completed.
word count: 15
JustinVanRegenmorter
Posts: 538
Joined: August 26th, 2021, 9:56 am
Contact:

Re: ReadDelimitedFile Exception with Quoted Headers

Unread post by JustinVanRegenmorter »

This issue has been resolved as of RunTime revision 906.
word count: 10
Post Reply