Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Careau
Contributor II
Contributor II

tFileInputDelimited using header name to order column

I have To import a csv file in a table.
I use a tFileInputDelimited -> tMap -> tDbOutput
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.

Is there a way to parse the csv using the column header name instead of the fixed column order specified in the tMap?

Labels (1)
  • v8.x

1 Reply
gvarun_arthasolutions
Partner - Contributor III
Partner - Contributor III

Hello,

tFileInputDelimited maps columns by position, not by header name.

Even if you tick “Set heading row as column names,” that only helps with metadata display — it doesn’t dynamically reorder the data.

Talend doesn’t have a built‑in “map by header name” option in tFileInputDelimited.

Workarounds

  1. Use tFileInputDelimited + tSchemaComplianceCheck
  • Read the file as raw strings (e.g., all columns as String).
  • Use the header row to detect column positions.
  • Then remap dynamically in a tMap or tJavaRow.
  1. Read as a single line and parse yourself
  • Configure tFileInputDelimited with only one column (the whole line).
  • In a tJavaRow or tExtractDelimitedFields, split the line by delimiter.
  • Use the header row to build a map of headerName → index.
  • Then extract values by header name, regardless of order.

Example in tJavaRow:

String[] headers = (String[])globalMap.get("headers"); // stored earlier

String[] values = input_row.line.split(";");

output_row.myColumn = values[findIndex(headers, "myColumnHeader")];

  1. Use tFileInputFullRow + custom parsing
  • Similar to above, but gives you the entire row as a string.
  • You can then parse with Java or Talend routines, using header names.
  1. Switch to tFileInputPositional or tFileInputRegex
  • If the file format is flexible, regex or positional parsing can give you more control.
  • Still requires custom logic to align headers with values.
  1. Pre‑process the file
  • Run a small preprocessing job that:
    • Reads the header row
    • Reorders the columns into a fixed order
    • Writes out a “normalized” CSV
  • Then feed that normalized CSV into your existing Talend flow.
    Thanks