<?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: Reading values in CSV headers in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375353#M137785</link>
    <description>&lt;A href="https://community.talend.com/legacyfs/online/68224/output.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGVl.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138178iCE568884E3DF9C1D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGVl.png" alt="0683p000009MGVl.png" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/tmap.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGUA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143845iD50666C558D1A455/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGUA.png" alt="0683p000009MGUA.png" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/Job.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGRK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132623iC62F35F08735A322/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGRK.png" alt="0683p000009MGRK.png" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/input2.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGeI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149352i9664527EB5E64D53/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGeI.png" alt="0683p000009MGeI.png" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/input2.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGeI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149352i9664527EB5E64D53/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGeI.png" alt="0683p000009MGeI.png" /&gt;&lt;/span&gt; &lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</description>
    <pubDate>Tue, 11 Aug 2015 10:37:09 GMT</pubDate>
    <dc:creator>IanM</dc:creator>
    <dc:date>2015-08-11T10:37:09Z</dc:date>
    <item>
      <title>Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375347#M137779</link>
      <description>&lt;P&gt;I have an input CSV file that looks like this -&lt;BR /&gt;&lt;STRONG&gt;GBI_EMGLOBAL_DIV ,20150101&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;BIG ID,Local ID,Bond Description,Liquidity&lt;/STRONG&gt;&lt;BR /&gt;XID0035,FR55,Indonesia 7.3750%&amp;nbsp; IDGB&amp;nbsp; Sep 2016,Traded&lt;BR /&gt;XID0041,FR60,Indonesia 6.2500%&amp;nbsp; IDGB&amp;nbsp; Apr 2017,Traded&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The header has two columns in first row followed by the actual header row consisting of 4 columns and the corresponding values in row 3 onwards. I want the Output CSV to look like&lt;BR /&gt;&lt;STRONG&gt;BIG ID, Local ID, Bond Description, Liquidity, FileDate &lt;/STRONG&gt;as column header and the values exactly same as row 3 onwards but an extra column called &lt;STRONG&gt;FileDate&lt;/STRONG&gt;&amp;nbsp;in the header and the value to be 20150101. This value is extracted from column 2 in row 1. Could someone please point me in right direction.&lt;BR /&gt;&lt;BR /&gt;The output CSV should look like -&lt;BR /&gt;&lt;STRONG&gt;BIG ID, Local ID, Bond Description, Liquidity, FileDate&lt;/STRONG&gt;&lt;BR /&gt;XID0035,FR55,Indonesia 7.3750%&amp;nbsp; IDGB&amp;nbsp; Sep 2016,Traded,20150101&lt;BR /&gt;XID0041,FR60,Indonesia 6.2500%&amp;nbsp; IDGB&amp;nbsp; Apr 2017,Traded,20150101&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 15:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375347#M137779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-10T15:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375348#M137780</link>
      <description>I've done this before by creating a tFileList with two iterate outputs. The first iterate reads the file for row one only (Header = 0, Limit = 1) and you can then set a string global variable equal to the value in Column 2 (your date).
&lt;BR /&gt;The second iterate reads the file again, but this time with header set as 2, so it starts at BIG ID. If you then feed in to a tMap, you can insert a new column FileDate and set the value to the global variable above.
&lt;BR /&gt;The variable is changed on each new file.
&lt;BR /&gt;Make sure you get the iterate order correct.
&lt;BR /&gt;Ian</description>
      <pubDate>Mon, 10 Aug 2015 20:15:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375348#M137780</guid>
      <dc:creator>IanM</dc:creator>
      <dc:date>2015-08-10T20:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375349#M137781</link>
      <description>Thank you I actually started something on similar. Except I used two tFileList&amp;nbsp;where one outputs with Header =&amp;nbsp;0 and Limit = 1 as per your suggestion and second with Header = 2, the&amp;nbsp;iterate output of both go to tFileInputDelimited. But there was inconsistency in the output file where some rows from file two has dates of file 1 etc. I am trying to get two iterate outputs out of single tFileList but the tFileInputDelimited only accepts one. Sorry this is only my first week with Talend therefore might be asking stupid questions.</description>
      <pubDate>Tue, 11 Aug 2015 09:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375349#M137781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-11T09:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375350#M137782</link>
      <description>Just wanted to add another way of doing this job..&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;as you have developed it using tFilelist a I would like to add some points further to that.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;redesign your job as follows.&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;tFileList---iterator----tFileInputdelimited---tJavaRow---tMap---youroutput&lt;/PRE&gt; 
&lt;BR /&gt;[list=*] 
&lt;BR /&gt; 
&lt;LI&gt;In tFileInputDelimited don`t skip the header rows.&amp;nbsp;&lt;/LI&gt; 
&lt;BR /&gt; 
&lt;LI&gt;Create context&amp;nbsp;variable FileDate.&lt;/LI&gt; 
&lt;BR /&gt; 
&lt;LI&gt;Now go to tJavaRow and add following code in it.&amp;nbsp;&lt;/LI&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;if(!Relational.iSnull(input_row.FirstColumn) &amp;amp;&amp;amp; input_row.FirstColumn.startsWith("GBI_EMG"))&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp; context.FileDate=input_row.SecondColumn; //you can convert it to proper date&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;[list=*] 
&lt;BR /&gt; 
&lt;LI&gt;Go to tMap and add extra column at output to create expected output file&lt;/LI&gt; 
&lt;BR /&gt; 
&lt;LI&gt;Use&amp;nbsp;context.FileDate variable to add inside FileDate column.&amp;nbsp;&lt;/LI&gt; 
&lt;BR /&gt; 
&lt;LI&gt;inside output Filter expression you can add below filter expression to filter out header rows.&amp;nbsp;&lt;/LI&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;!row1.FirstColumn.startsWith("GBI_EMG") &amp;amp;&amp;amp;&amp;nbsp;!row1.FirstColumn.startsWith("BIG ID")&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;you need to modify some of the things as per your job design and actual columns but this will give you exact output you are looking.&amp;nbsp;</description>
      <pubDate>Tue, 11 Aug 2015 10:26:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375350#M137782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-11T10:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375351#M137783</link>
      <description>That didn't come out as expected! I'll try again.</description>
      <pubDate>Tue, 11 Aug 2015 10:26:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375351#M137783</guid>
      <dc:creator>IanM</dc:creator>
      <dc:date>2015-08-11T10:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375352#M137784</link>
      <description>See attached images</description>
      <pubDate>Tue, 11 Aug 2015 10:32:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375352#M137784</guid>
      <dc:creator>IanM</dc:creator>
      <dc:date>2015-08-11T10:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375353#M137785</link>
      <description>&lt;A href="https://community.talend.com/legacyfs/online/68224/output.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGVl.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138178iCE568884E3DF9C1D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGVl.png" alt="0683p000009MGVl.png" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/tmap.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGUA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143845iD50666C558D1A455/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGUA.png" alt="0683p000009MGUA.png" /&gt;&lt;/span&gt;&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/Job.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGRK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132623iC62F35F08735A322/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGRK.png" alt="0683p000009MGRK.png" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/input2.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGeI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149352i9664527EB5E64D53/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGeI.png" alt="0683p000009MGeI.png" /&gt;&lt;/span&gt; &lt;/A&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/68224/input2.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGeI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149352i9664527EB5E64D53/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGeI.png" alt="0683p000009MGeI.png" /&gt;&lt;/span&gt; &lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</description>
      <pubDate>Tue, 11 Aug 2015 10:37:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375353#M137785</guid>
      <dc:creator>IanM</dc:creator>
      <dc:date>2015-08-11T10:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375354#M137786</link>
      <description>&lt;A href="https://community.talend.com/legacyfs/online/68224/input1.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGeN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133454i06B8D51735275A21/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGeN.png" alt="0683p000009MGeN.png" /&gt;&lt;/span&gt;&lt;/A&gt;</description>
      <pubDate>Tue, 11 Aug 2015 10:38:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375354#M137786</guid>
      <dc:creator>IanM</dc:creator>
      <dc:date>2015-08-11T10:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375355#M137787</link>
      <description>&lt;A href="https://community.talend.com/legacyfs/online/68224/globalvar.png" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MGeS.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145906i049A747816552044/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MGeS.png" alt="0683p000009MGeS.png" /&gt;&lt;/span&gt;&lt;/A&gt;</description>
      <pubDate>Tue, 11 Aug 2015 10:40:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375355#M137787</guid>
      <dc:creator>IanM</dc:creator>
      <dc:date>2015-08-11T10:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading values in CSV headers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375356#M137788</link>
      <description>Ok I managed in the end. Thanks once again for pointing me in right direction. Not sure why it didn't allow me to create two iterate outputs, I deleted the components and tried again. tFileList - Iterate1 - tfileInputDelimited and Iterate2 to another tfileInputdelimited. Output of first to globalvar and second to tmap, tmap uses the var for date, output of that goes to tUnite which merges all my input files into one and that goes to tFileOutputDelimited. Perfect!!!.</description>
      <pubDate>Tue, 11 Aug 2015 10:53:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Reading-values-in-CSV-headers/m-p/2375356#M137788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-11T10:53:24Z</dc:date>
    </item>
  </channel>
</rss>

