<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tExtractDelimitedFields on variable location field in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tExtractDelimitedFields-on-variable-location-field/m-p/2233534#M23180</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;We have raised a new feature jira issue on talend bug tracker.&lt;/P&gt; 
&lt;P&gt;&lt;A title="https://jira.talendforge.org/browse/TDI-30555" href="https://jira.talendforge.org/browse/TDI-30555" target="_self" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/browse/TDI-30555&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;Could you please try this solution to see if it&amp;nbsp; may work for your use case?&lt;/P&gt; 
&lt;P&gt;tFileInputRaw -&amp;gt; tConvertType -&amp;gt; tNormalize -&amp;gt; tExtractDelimitedFields -&amp;gt; tLogRow&lt;BR /&gt;tFileInput raw is reading a csv-file as a string. The schema has one column content, of type document.&lt;BR /&gt;tConvertType converts column content type document to column content type string&lt;BR /&gt;tNormalize normalizes on "\n" so from 1 input object flow getting a flow with multiple single rows&lt;BR /&gt;tExtractDelimitedFields extracts columns from every single row&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
    <pubDate>Wed, 21 Nov 2018 03:21:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-21T03:21:13Z</dc:date>
    <item>
      <title>tExtractDelimitedFields on variable location field</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tExtractDelimitedFields-on-variable-location-field/m-p/2233533#M23179</link>
      <description>&lt;P&gt;I am wondering why there is no option to specify CSV Parameters for tExtractDelimitedFields.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My use case is to parse a field with my schema definition and to allow quotes embedded in double quotes in the incoming field to make sure that the row parsing is not confused. To my amazement there is no option that I can find to specify this.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Even the tNormalize component allows for the specification for CSV Parameters&lt;/P&gt; 
&lt;P&gt;Escape mode:doubled | backslash&lt;/P&gt; 
&lt;P&gt;Text enclosure """&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I ended up having to replace quoted commas with the code below with ascii "0" and then writing another similar component to switch the ASCII 0 back to commas after the tExtractDelimitedFields component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;There must be a better way. Any ideas?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJavaRow - ReplaceQuotedCommas&lt;/P&gt; 
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt; iSentinel=0;&lt;/P&gt; 
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;String cvsString = input_row.returnVal ;&lt;/P&gt; 
&lt;P class="p3"&gt;&lt;SPAN class="s2"&gt;String rePattern =&lt;/SPAN&gt;"(\"[^\",]+),([^\"]*\")"&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P class="p4"&gt;// first replace&lt;/P&gt; 
&lt;P class="p1"&gt;String oldString = cvsString;&lt;/P&gt; 
&lt;P class="p1"&gt;String resultString = cvsString.replaceAll(rePattern, &lt;SPAN class="s3"&gt;"$1"&lt;/SPAN&gt;+ Character.toString ((&lt;SPAN class="s1"&gt;&lt;STRONG&gt;char&lt;/STRONG&gt;&lt;/SPAN&gt;) iSentinel)+ &lt;SPAN class="s3"&gt;"$2"&lt;/SPAN&gt;);&lt;/P&gt; 
&lt;P class="p4"&gt;// additional replcaes until until no more changes&lt;/P&gt; 
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;while&lt;/STRONG&gt;&lt;/SPAN&gt; (!resultString.equalsIgnoreCase(oldString)){&lt;/P&gt; 
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;oldString = resultString;&lt;/P&gt; 
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;resultString = resultString.replaceAll(rePattern, &lt;SPAN class="s3"&gt;"$1"&lt;/SPAN&gt;+ Character.toString ((&lt;SPAN class="s1"&gt;&lt;STRONG&gt;char&lt;/STRONG&gt;&lt;/SPAN&gt;) iSentinel)+ &lt;SPAN class="s3"&gt;"$2"&lt;/SPAN&gt;);&lt;/P&gt; 
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt; 
&lt;P class="p1"&gt;System.out.println(&lt;SPAN class="s3"&gt;"Before: "&lt;/SPAN&gt; + cvsString);&lt;/P&gt; 
&lt;P class="p4"&gt;//System.out.println("Result: " + resultString);&lt;/P&gt; 
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;output_row.returnVal = resultString;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tExtractDelimitedFields-on-variable-location-field/m-p/2233533#M23179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T07:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: tExtractDelimitedFields on variable location field</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tExtractDelimitedFields-on-variable-location-field/m-p/2233534#M23180</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;We have raised a new feature jira issue on talend bug tracker.&lt;/P&gt; 
&lt;P&gt;&lt;A title="https://jira.talendforge.org/browse/TDI-30555" href="https://jira.talendforge.org/browse/TDI-30555" target="_self" rel="nofollow noopener noreferrer"&gt;https://jira.talendforge.org/browse/TDI-30555&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;Could you please try this solution to see if it&amp;nbsp; may work for your use case?&lt;/P&gt; 
&lt;P&gt;tFileInputRaw -&amp;gt; tConvertType -&amp;gt; tNormalize -&amp;gt; tExtractDelimitedFields -&amp;gt; tLogRow&lt;BR /&gt;tFileInput raw is reading a csv-file as a string. The schema has one column content, of type document.&lt;BR /&gt;tConvertType converts column content type document to column content type string&lt;BR /&gt;tNormalize normalizes on "\n" so from 1 input object flow getting a flow with multiple single rows&lt;BR /&gt;tExtractDelimitedFields extracts columns from every single row&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 03:21:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tExtractDelimitedFields-on-variable-location-field/m-p/2233534#M23180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-21T03:21:13Z</dc:date>
    </item>
  </channel>
</rss>

