<?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: How to Map Dynamic Columns from an Input CSV file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323958#M93725</link>
    <description>&lt;P&gt;Thank you, @Shicong Hong​. Looks good now.&lt;/P&gt;&lt;P&gt;It looks like I changed the Field separator to hyphen so it would appear on the log that the separator is semi-colon which should not be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try this on the actual data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000Wth0vAAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138002i692B514765AD3693/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000Wth0vAAB.png" alt="0695b00000Wth0vAAB.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 12:20:04 GMT</pubDate>
    <dc:creator>jerownimow</dc:creator>
    <dc:date>2022-09-23T12:20:04Z</dc:date>
    <item>
      <title>How to Map Dynamic Columns from an Input CSV file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323956#M93723</link>
      <description>&lt;P&gt;I have exactly the same scenario as this article &lt;A href="https://www.talend.com/resources/talend-dynamic-schema/" target="_blank"&gt;https://www.talend.com/resources/talend-dynamic-schema/&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The field positions on my input are varying so I have to come up of a way to have it fix every time I will receive the source file.&lt;/P&gt;&lt;P&gt;I followed the same procedure but I can't get the correct output. Looks like the issue is on the java code that was provided on the article.&lt;/P&gt;&lt;P&gt;Badly needed a help on this one.&lt;/P&gt;&lt;P&gt;Java Code:&lt;/P&gt;&lt;P&gt;String strArray[] = ((String)globalMap.get("row1.col_list")). split(";");&lt;/P&gt;&lt;P&gt;System.out.println("Target col list: "+((String)globalMap.get("row1.col_list")). split(";"));&lt;/P&gt;&lt;P&gt;String tarArray[] = ((String)globalMap.get("row1.col_list")). split(";");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynamic columns = row6.data;&lt;/P&gt;&lt;P&gt;String out="";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (int i = 0; i &amp;lt; columns.getColumnCount(); i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;DynamicMetadata columnMetadata = columns.getColumnMetadata(i);&lt;/P&gt;&lt;P&gt;String inp_col=columnMetadata.getName().toString();&lt;/P&gt;&lt;P&gt;String col_val=(String)row6.data.getColumnValue(inp_col);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (int j = 0; j &amp;lt; columns.getColumnCount(); j++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;if (inp_col.equals(strArray[j].toString()))&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;tarArray[j]=col_val;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (int t=0; t &amp;lt; columns.getColumnCount(); t++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;if (t ==0)&lt;/P&gt;&lt;P&gt;out=tarArray[0];&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;out=out+";"+tarArray[t];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;row5.data=out;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set-up on Database:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000Wtb8oAAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158075i27CA00E01299C26A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000Wtb8oAAB.png" alt="0695b00000Wtb8oAAB.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;*Strange part is that when the col_list was split, it has a weird output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000Wtb8yAAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144667iC34BF8F1AE51E147/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000Wtb8yAAB.png" alt="0695b00000Wtb8yAAB.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000Wtb9cAAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144258i800F1994CAC48338/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000Wtb9cAAB.png" alt="0695b00000Wtb9cAAB.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:31:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323956#M93723</guid>
      <dc:creator>jerownimow</dc:creator>
      <dc:date>2024-11-15T22:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to Map Dynamic Columns from an Input CSV file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323957#M93724</link>
      <description>&lt;P&gt;Hi​&lt;/P&gt;&lt;P&gt;I just tested the Java code with studio 8 and it works, one thing you need to pay attention to is that the input file should contain the column name in the first line if you are using Dynamic schema to read it, eg:&lt;/P&gt;&lt;P&gt;name;id&lt;/P&gt;&lt;P&gt;AL;1&lt;/P&gt;&lt;P&gt;Mike;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 08:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323957#M93724</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-23T08:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Map Dynamic Columns from an Input CSV file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323958#M93725</link>
      <description>&lt;P&gt;Thank you, @Shicong Hong​. Looks good now.&lt;/P&gt;&lt;P&gt;It looks like I changed the Field separator to hyphen so it would appear on the log that the separator is semi-colon which should not be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try this on the actual data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000Wth0vAAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138002i692B514765AD3693/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000Wth0vAAB.png" alt="0695b00000Wth0vAAB.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 12:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323958#M93725</guid>
      <dc:creator>jerownimow</dc:creator>
      <dc:date>2022-09-23T12:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to Map Dynamic Columns from an Input CSV file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323959#M93726</link>
      <description>&lt;P&gt;@Jerome Sabareza​&amp;nbsp;, glad to hear that you get it working now.  Feel free to post questions if you have any issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 23:40:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Map-Dynamic-Columns-from-an-Input-CSV-file/m-p/2323959#M93726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-25T23:40:24Z</dc:date>
    </item>
  </channel>
</rss>

