Flat File Reader Error - Bad Quote Format?

Support/help with CloverETL implementation problems

Posts: 16
Joined: Fri May 22, 2015 7:53 pm

Flat File Reader Error - Bad Quote Format?

Postby hneff1 » Tue Jul 11, 2017 11:11 pm

Hi. I am using the flat file reader component to read a pipe delimited text file. I have a attached a screen shot of my settings. For the record shown below I am getting a bad quote format error.

|Parsing error: Bad quote format in record 32, field 64 ("_64"), metadata "I_ConcurFileData_220"; value: 'DETAIL|2883|2017-07-10|32|00055280|Houglan|Catherine|A|XY-Corp-US|901476|XY-Corp-US||||||||5B0E28901338406D9A2A|433491|XYZ US- JD|USD|UNITED STATES|2017-06-26|2017-05-31|2017-07-10|May 9-25, 2017 Expenses|Biomet Policy|||||ZB-Corp-US|901476||||||||||||||||||||||5093226|CHD|Employee Meals (Lunch)|2017-05-10|USD|1.00|M|N|"Coaching in the Moment" Workshop/Lunch||HONEYBAKED HAM #8402|6|800035|ZB-Corp-US|||||||||||||||||||||||||||||||||||||||US||||0.00|74.81|74.81|74.81|74.81||1343888|EMP76123|Employee|EMPONE|Smith|Doug|Xyz|Design Sr Engineer I|0.00|0.00|USD|||||||||||||||||||||12.47|12.47|12.47|1|N||||||||US|US-OH|Canton|||||||||||||||||||||||||||||||||||||||||||||||||||||||||\r\n'|/mnt/efs/ftp-data/xyz/inbound/extract_attendee_detail_20170710162534.txt

I was reading the clover documentation at: http://doc.cloveretl.com/documentation/ ... -file.html says the following:
"Alternatively, use the Quote char combo box to select which kind of quotation marks should be removed from string fields. Do not forget to click Reparse after you select one of the options: " or ' or Both " and '. Quotation marks have to form a pair and selecting one kind of Quote char results in ignoring the other one (e.g. if you select " then they will be removed from each field while all ' characters are treated as common strings). If you need to retain the actual quote character in the field, it has to be escaped, e.g. "" - this will be extracted as a single ". Delimiters (selected in Delimiter) surrounded by quotes are ignored. What is more, you can enter your own delimiter into the combo box as a single character, e.g. the pipe - type only | (no quotes around).

"person" - will be extracted as person (Quote char set to " or Both " and ')
"address"1 - will not be extracted and the field will show an error; the reason is the delimiter is expected right after the quotes ("address"; would be fine with ; as the delimiter)
first"Name" - will be extracted as first"Name" - if there is no quotation mark at the beginning of the field, the whole field is regarded as a common string
"'doubleQuotes'" (Quote char set to " or Both " and ') - will be extracted as 'doubleQuotes' as only the outer quotation marks are always removed and the rest of the field is left untouched
"unpaired - will not be extracted as quotation marks have be in pair; this would be an error
'delimiter;' (with Quote char set to ' or Both " and ' and Delimiter set to ;) - will be extracted as delimiter; as the delimiter inside quotation marks is ignored"

I have my quote char setting set to " so like the first"Name" example above which would be similar to "Coaching in the Moment" data in column 64 in my record. With this setting, I do not understand why I am getting an error. I am also attaching my meta data format below:
<Metadata id="Metadata8" previewAttachmentCharset="UTF-8">
<Record fieldDelimiter="|" name="I_ConcurFileData_220" previewAttachmentCharset="UTF-8" recordDelimiter="\n" type="delimited">
<Field label="1" name="_1" type="string"/>
<Field label="2" name="_2" type="string"/>
<Field label="3" name="_3" type="string"/>
<Field label="4" name="_4" type="string"/>
<Field label="5" name="_5" type="string"/>
<Field label="6" name="_6" type="string"/>
<Field label="7" name="_7" type="string"/>
<Field label="8" name="_8" type="string"/>
<Field label="9" name="_9" type="string"/>
<Field label="10" name="_10" type="string"/>
<Field label="11" name="_11" type="string"/>
<Field label="12" name="_12" type="string"/>
<Field label="13" name="_13" type="string"/>
<Field label="14" name="_14" type="string"/>
<Field label="15" name="_15" type="string"/>
<Field label="16" name="_16" type="string"/>
<Field label="17" name="_17" type="string"/>
<Field label="18" name="_18" type="string"/>
<Field label="19" name="_19" type="string"/>
<Field label="20" name="_20" type="string"/>
<Field label="21" name="_21" type="string"/>
<Field label="22" name="_22" type="string"/>
<Field label="23" name="_23" type="string"/>
<Field label="24" name="_24" type="string"/>
<Field label="25" name="_25" type="string"/>
<Field label="26" name="_26" type="string"/>
<Field label="27" name="_27" type="string"/>
<Field label="28" name="_28" type="string"/>
<Field label="29" name="_29" type="string"/>
<Field label="30" name="_30" type="string"/>
<Field label="31" name="_31" type="string"/>
<Field label="32" name="_32" type="string"/>
<Field label="33" name="_33" type="string"/>
<Field label="34" name="_34" type="string"/>
<Field label="35" name="_35" type="string"/>
<Field label="36" name="_36" type="string"/>
<Field label="37" name="_37" type="string"/>
<Field label="38" name="_38" type="string"/>
<Field label="39" name="_39" type="string"/>
<Field label="40" name="_40" type="string"/>
<Field label="41" name="_41" type="string"/>
<Field label="42" name="_42" type="string"/>
<Field label="43" name="_43" type="string"/>
<Field label="44" name="_44" type="string"/>
<Field label="45" name="_45" type="string"/>
<Field label="46" name="_46" type="string"/>
<Field label="47" name="_47" type="string"/>
<Field label="48" name="_48" type="string"/>
<Field label="49" name="_49" type="string"/>
<Field label="50" name="_50" type="string"/>
<Field label="51" name="_51" type="string"/>
<Field label="52" name="_52" type="string"/>
<Field label="53" name="_53" type="string"/>
<Field label="54" name="_54" type="string"/>
<Field label="55" name="_55" type="string"/>
<Field label="56" name="_56" type="string"/>
<Field label="57" name="_57" type="string"/>
<Field label="58" name="_58" type="string"/>
<Field label="59" name="_59" type="string"/>
<Field label="60" name="_60" type="string"/>
<Field label="61" name="_61" type="string"/>
<Field label="62" name="_62" type="string"/>
<Field label="63" name="_63" type="string"/>
<Field label="64" name="_64" type="string"/>
<Field label="65" name="_65" type="string"/>
<Field label="66" name="_66" type="string"/>
<Field label="67" name="_67" type="string"/>
<Field label="68" name="_68" type="string"/>
<Field label="69" name="_69" type="string"/>
<Field label="70" name="_70" type="string"/>
<Field label="71" name="_71" type="string"/>
<Field label="72" name="_72" type="string"/>
<Field label="73" name="_73" type="string"/>
<Field label="74" name="_74" type="string"/>
<Field label="75" name="_75" type="string"/>
<Field label="76" name="_76" type="string"/>
<Field label="77" name="_77" type="string"/>
<Field label="78" name="_78" type="string"/>
<Field label="79" name="_79" type="string"/>
<Field label="80" name="_80" type="string"/>
<Field label="81" name="_81" type="string"/>
<Field label="82" name="_82" type="string"/>
<Field label="83" name="_83" type="string"/>
<Field label="84" name="_84" type="string"/>
<Field label="85" name="_85" type="string"/>
<Field label="86" name="_86" type="string"/>
<Field label="87" name="_87" type="string"/>
<Field label="88" name="_88" type="string"/>
<Field label="89" name="_89" type="string"/>
<Field label="90" name="_90" type="string"/>
<Field label="91" name="_91" type="string"/>
<Field label="92" name="_92" type="string"/>
<Field label="93" name="_93" type="string"/>
<Field label="94" name="_94" type="string"/>
<Field label="95" name="_95" type="string"/>
<Field label="96" name="_96" type="string"/>
<Field label="97" name="_97" type="string"/>
<Field label="98" name="_98" type="string"/>
<Field label="99" name="_99" type="string"/>
<Field label="100" name="_100" type="string"/>
<Field label="101" name="_101" type="string"/>
<Field label="102" name="_102" type="string"/>
<Field label="103" name="_103" type="string"/>
<Field label="104" name="_104" type="string"/>
<Field label="105" name="_105" type="string"/>
<Field label="106" name="_106" type="string"/>
<Field label="107" name="_107" type="string"/>
<Field label="108" name="_108" type="string"/>
<Field label="109" name="_109" type="string"/>
<Field label="110" name="_110" type="string"/>
<Field label="111" name="_111" type="string"/>
<Field label="112" name="_112" type="string"/>
<Field label="113" name="_113" type="string"/>
<Field label="114" name="_114" type="string"/>
<Field label="115" name="_115" type="string"/>
<Field label="116" name="_116" type="string"/>
<Field label="117" name="_117" type="string"/>
<Field label="118" name="_118" type="string"/>
<Field label="119" name="_119" type="string"/>
<Field label="120" name="_120" type="string"/>
<Field label="121" name="_121" type="string"/>
<Field label="122" name="_122" type="string"/>
<Field label="123" name="_123" type="string"/>
<Field label="124" name="_124" type="string"/>
<Field label="125" name="_125" type="string"/>
<Field label="126" name="_126" type="string"/>
<Field label="127" name="_127" type="string"/>
<Field label="128" name="_128" type="string"/>
<Field label="129" name="_129" type="string"/>
<Field label="130" name="_130" type="string"/>
<Field label="131" name="_131" type="string"/>
<Field label="132" name="_132" type="string"/>
<Field label="133" name="_133" type="string"/>
<Field label="134" name="_134" type="string"/>
<Field label="135" name="_135" type="string"/>
<Field label="136" name="_136" type="string"/>
<Field label="137" name="_137" type="string"/>
<Field label="138" name="_138" type="string"/>
<Field label="139" name="_139" type="string"/>
<Field label="140" name="_140" type="string"/>
<Field label="141" name="_141" type="string"/>
<Field label="142" name="_142" type="string"/>
<Field label="143" name="_143" type="string"/>
<Field label="144" name="_144" type="string"/>
<Field label="145" name="_145" type="string"/>
<Field label="146" name="_146" type="string"/>
<Field label="147" name="_147" type="string"/>
<Field label="148" name="_148" type="string"/>
<Field label="149" name="_149" type="string"/>
<Field label="150" name="_150" type="string"/>
<Field label="151" name="_151" type="string"/>
<Field label="152" name="_152" type="string"/>
<Field label="153" name="_153" type="string"/>
<Field label="154" name="_154" type="string"/>
<Field label="155" name="_155" type="string"/>
<Field label="156" name="_156" type="string"/>
<Field label="157" name="_157" type="string"/>
<Field label="158" name="_158" type="string"/>
<Field label="159" name="_159" type="string"/>
<Field label="160" name="_160" type="string"/>
<Field label="161" name="_161" type="string"/>
<Field label="162" name="_162" type="string"/>
<Field label="163" name="_163" type="string"/>
<Field label="164" name="_164" type="string"/>
<Field label="165" name="_165" type="string"/>
<Field label="166" name="_166" type="string"/>
<Field name="_167" type="string"/>
<Field name="_168" type="string"/>
<Field name="_169" type="string"/>
<Field name="_170" type="string"/>
<Field name="_171" type="string"/>
<Field name="_172" type="string"/>
<Field name="_173" type="string"/>
<Field name="_174" type="string"/>
<Field name="_175" type="string"/>
<Field name="_176" type="string"/>
<Field name="_177" type="string"/>
<Field name="_178" type="string"/>
<Field name="_179" type="string"/>
<Field name="_180" type="string"/>
<Field name="_181" type="string"/>
<Field name="_182" type="string"/>
<Field name="_183" type="string"/>
<Field name="_184" type="string"/>
<Field name="_185" type="string"/>
<Field name="_186" type="string"/>
<Field name="_187" type="string"/>
<Field name="_188" type="string"/>
<Field name="_189" type="string"/>
<Field name="_190" type="string"/>
<Field name="_191" type="string"/>
<Field name="_192" type="string"/>
<Field name="_193" type="string"/>
<Field name="_194" type="string"/>
<Field name="_195" type="string"/>
<Field name="_196" type="string"/>
<Field name="_197" type="string"/>
<Field name="_198" type="string"/>
<Field name="_199" type="string"/>
<Field name="_200" type="string"/>
<Field name="_201" type="string"/>
<Field name="_202" type="string"/>
<Field name="_203" type="string"/>
<Field name="_204" type="string"/>
<Field name="_205" type="string"/>
<Field name="_206" type="string"/>
<Field name="_207" type="string"/>
<Field name="_208" type="string"/>
<Field name="_209" type="string"/>
<Field name="_210" type="string"/>
<Field name="_211" type="string"/>
<Field name="_212" type="string"/>
<Field name="_213" type="string"/>
<Field name="_214" type="string"/>
<Field name="_215" type="string"/>
<Field name="_216" type="string"/>
<Field name="_217" type="string"/>
<Field name="_218" type="string"/>
<Field name="_219" type="string"/>
<Field name="_220" type="string"/>

Thanks for any info you can provide.

DataReaderSettings.jpeg (365.99 KiB) Viewed 119 times

Posts: 20
Joined: Wed May 03, 2017 12:10 pm

Re: Flat File Reader Error - Bad Quote Format?

Postby bartonv » Thu Jul 13, 2017 12:06 pm

Hi Heather,
thank you for the detailed explanation of the issue. When it comes to matching your example with the examples in our documentation, however, I beg to differ. The string that causes the parsing error in your graph ("Coaching in the Moment" Workshop/Lunch) looks a lot like the "address"1 example from our documentation (as opposed to the first"Name" example). The reason for this is that the pipe (|) delimiter is not placed right after the quotes (for example "Coaching in the Moment Workshop/Lunch" would flow through the graph nicely) so the parsing error is actually justified here.
From looking at your screenshot, it appears that you have the Data Policy property of the FlatFileReader set to ‘Controlled’. Therefore, I would suggest taking advantage of the second port and design an alternative thread that would deal with bad parsing error records. You could use the Reformat component for the purpose of removing the quotes from the original record, for example by applying the Replace function in the following fashion:

Code: Select all

function integer transform() {
   $out.0.field1 = replace($in.0.originalData,'"',"");

   return ALL;

Vladimir Barton
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com
How to speed up communication with CloverCARE support

Posts: 16
Joined: Fri May 22, 2015 7:53 pm

Re: Flat File Reader Error - Bad Quote Format?

Postby hneff1 » Thu Jul 20, 2017 1:04 pm


Thanks for your help! I took advantage of second port to fix problem records containing quotes. Then read those records again to either put the fixed records back into the processing stream or send email with any additional errors. Worked great!