<?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 tFileInputDelimited using header name to order column in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tFileInputDelimited-using-header-name-to-order-column/m-p/2439932#M142393</link>
    <description>&lt;P&gt;I have To import a csv file in a table.&lt;BR /&gt;I use a&amp;nbsp;tFileInputDelimited -&amp;gt; tMap -&amp;gt; tDbOutput&lt;BR /&gt;It's working well. But the system that provided me with the file cannot assure me that the columns will always be in the same order.&lt;BR /&gt;&lt;BR /&gt;Is there a way to parse the csv using the column header name instead of the fixed column order specified in the tMap?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 18:43:05 GMT</pubDate>
    <dc:creator>Careau</dc:creator>
    <dc:date>2024-04-10T18:43:05Z</dc:date>
    <item>
      <title>tFileInputDelimited using header name to order column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputDelimited-using-header-name-to-order-column/m-p/2439932#M142393</link>
      <description>&lt;P&gt;I have To import a csv file in a table.&lt;BR /&gt;I use a&amp;nbsp;tFileInputDelimited -&amp;gt; tMap -&amp;gt; tDbOutput&lt;BR /&gt;It's working well. But the system that provided me with the file cannot assure me that the columns will always be in the same order.&lt;BR /&gt;&lt;BR /&gt;Is there a way to parse the csv using the column header name instead of the fixed column order specified in the tMap?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 18:43:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputDelimited-using-header-name-to-order-column/m-p/2439932#M142393</guid>
      <dc:creator>Careau</dc:creator>
      <dc:date>2024-04-10T18:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputDelimited using header name to order column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputDelimited-using-header-name-to-order-column/m-p/2537596#M148203</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;tFileInputDelimited&amp;nbsp;maps columns by&amp;nbsp;position, not by header name.&lt;/P&gt;&lt;P&gt;Even if you tick “Set heading row as column names,” that only helps with metadata display — it doesn’t dynamically reorder the data.&lt;/P&gt;&lt;P&gt;Talend doesn’t have a built‑in “map by header name” option in&amp;nbsp;tFileInputDelimited.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Workarounds&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Use&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;tFileInputDelimited&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;+&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;tSchemaComplianceCheck&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Read the file as raw strings (e.g., all columns as&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Use the header row to detect column positions.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Then remap dynamically in a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tMap&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tJavaRow&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Read as a single line and parse yourself&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Configure&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tFileInputDelimited&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;with only one column (the whole line).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;In a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tJavaRow&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tExtractDelimitedFields&lt;/SPAN&gt;&lt;SPAN&gt;, split the line by delimiter.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Use the header row to build a map of&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;headerName → index&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Then extract values by header name, regardless of order.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example in&amp;nbsp;tJavaRow:&lt;/P&gt;&lt;P&gt;String[] headers = (String[])globalMap.get("headers"); // stored earlier&lt;/P&gt;&lt;P&gt;String[] values = input_row.line.split(";");&lt;/P&gt;&lt;P&gt;output_row.myColumn = values[findIndex(headers, "myColumnHeader")];&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Use&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;tFileInputFullRow&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;+ custom parsing&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Similar to above, but gives you the entire row as a string.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;You can then parse with Java or Talend routines, using header names.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Switch to&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;tFileInputPositional&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;or&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;tFileInputRegex&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;If the file format is flexible, regex or positional parsing can give you more control.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Still requires custom logic to align headers with values.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Pre‑process the file&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Run a small preprocessing job that:&lt;/SPAN&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Reads the header row&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Reorders the columns into a fixed order&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Writes out a “normalized” CSV&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI&gt;&lt;SPAN&gt;Then feed that normalized CSV into your existing Talend flow.&lt;BR /&gt;&lt;/SPAN&gt;Thanks&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sat, 29 Nov 2025 20:42:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputDelimited-using-header-name-to-order-column/m-p/2537596#M148203</guid>
      <dc:creator>gvarun_arthasolutions</dc:creator>
      <dc:date>2025-11-29T20:42:13Z</dc:date>
    </item>
  </channel>
</rss>

