<?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: Finding field separator before processing the file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197626#M1296</link>
    <description>&lt;P&gt;I can't tell you exactly how to do this without doing it myself. It doesn't really serve you to do this myself as you will not learn. However, I am happy to give you my considerations for a problem like this.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) You know the separator types that it could be beforehand&lt;/P&gt; 
&lt;P&gt;2) With every file from the tFileList, you have the opportunity to pre check the first row of the file&lt;/P&gt; 
&lt;P&gt;3) You know how many columns there are in each file (otherwise this model for processing files will not work)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As such you have have all of the clues you need to identify which of the 3 separators that it could be. For each iteration of the tFileList you do not need to process the data in one subjob. You could load the the tFileList data, check the first row of the file, identify the separator (look at the split() function), save the details in a tHashOutput, then use a tHashInput to read the data in, iterate over it and read the file with the correct separator.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 00:05:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-12T00:05:43Z</dc:date>
    <item>
      <title>Finding field separator before processing the file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197621#M1291</link>
      <description>&lt;P&gt;My folder contains numerous files (.txt format) for which the field separator for few of the files is comma(,),&amp;nbsp;few of the files is pipe(|),&amp;nbsp;few of the files is semicolon(&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; and so on.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is there any option to extract the columns in the same job?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 08:12:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197621#M1291</guid>
      <dc:creator>McJingles</dc:creator>
      <dc:date>2020-02-11T08:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Finding field separator before processing the file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197622#M1292</link>
      <description>&lt;P&gt;Yes, what you need to do is use the tFileInputDelimited and set the "Field Separator" field to a context variable. Then you can set the value of the context variable at the beginning of the job or between processing files. This can be done. dynamically, but it may require a tiny bit of code.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 09:28:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197622#M1292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-11T09:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Finding field separator before processing the file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197623#M1293</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Can you please elaborate this further more?&lt;/P&gt; 
&lt;P&gt;I am new to Talend. Can you please share the code or any link to what you discussed?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 11:30:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197623#M1293</guid>
      <dc:creator>McJingles</dc:creator>
      <dc:date>2020-02-11T11:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding field separator before processing the file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197624#M1294</link>
      <description>&lt;P&gt;OK, in this example I have created a context variable called "sep". This can be seen here....&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-02-11 at 13.54.08.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M93Q.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133487i3BB865B8C988D484/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M93Q.png" alt="0683p000009M93Q.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have given it a value of ";" for this example. But context variable values can be set dynamically as well. You can assign the values in numerous ways. This is covered by other questions on the Community.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;After doing this, I configured my tFileInputDelimited component as below....&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-02-11 at 13.53.31.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M93V.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145558i5BC156E01B1F49BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M93V.png" alt="0683p000009M93V.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Notice the "Field Separator" field is populated by ....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;context.sep&lt;/PRE&gt; 
&lt;P&gt;This tells the component to use the value held by context.sep as the separator.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 12:58:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197624#M1294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-11T12:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Finding field separator before processing the file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197625#M1295</link>
      <description>&lt;P&gt;Good one&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="asdsa.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M93a.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145674iC0463D609019E19C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M93a.png" alt="0683p000009M93a.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've nearly 20 files in the folder which is defined in TFileList component. I would take all the files as input.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;That input files looks like&amp;nbsp;&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;AtmosRX | &lt;A href="http://www.atmosrx.com/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.atmosrx.com/&lt;/A&gt; | Product Feed 04-12-2019&amp;nbsp; -- Pipe(|) as a delimiter&lt;/LI&gt; 
 &lt;LI&gt;Bellelily , &lt;A href="http://www.bellelily.com/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.bellelily.com/&lt;/A&gt; , Bellelily products feed&amp;nbsp; -- Here, Comma(,) as a delimiter&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In this scenario, How can i extract the data using the delimiter Pipe(|) and Comma(,) in same job.?&lt;/P&gt; 
&lt;P&gt;Moreover, I don't know Which delimiter is present in that all the input files but Pipe, comma, semi-colon will be there.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:17:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197625#M1295</guid>
      <dc:creator>McJingles</dc:creator>
      <dc:date>2020-02-11T13:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Finding field separator before processing the file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197626#M1296</link>
      <description>&lt;P&gt;I can't tell you exactly how to do this without doing it myself. It doesn't really serve you to do this myself as you will not learn. However, I am happy to give you my considerations for a problem like this.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) You know the separator types that it could be beforehand&lt;/P&gt; 
&lt;P&gt;2) With every file from the tFileList, you have the opportunity to pre check the first row of the file&lt;/P&gt; 
&lt;P&gt;3) You know how many columns there are in each file (otherwise this model for processing files will not work)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As such you have have all of the clues you need to identify which of the 3 separators that it could be. For each iteration of the tFileList you do not need to process the data in one subjob. You could load the the tFileList data, check the first row of the file, identify the separator (look at the split() function), save the details in a tHashOutput, then use a tHashInput to read the data in, iterate over it and read the file with the correct separator.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 00:05:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Finding-field-separator-before-processing-the-file/m-p/2197626#M1296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-12T00:05:43Z</dc:date>
    </item>
  </channel>
</rss>

