Search code examples
stringsplittalendtalend-mdm

Using tab as delimiter in tFileInputDelimited component in Talend Open Studio


I have written an ETL in Talend Open Studio that loads a CSV/TSV file in a database. To do so, I want to provide the delimiter in tFileInputDelimited component using dynamic context load from a text file. I have specified it in the context file as fieldDelimiter="\t" and in the tFileInputDelimited component as shown in the screenshot. But, it doesn't work as a delimiter. I have also tried using fieldDelimiter="\\t" or fieldDelimiter="\u0009" (unicode character for tab).

What should I provide in the context file so that the delimiter is a tab character and not "\t" string as is happening in this case?


Solution

  • There is no function (String)context.get("key") that I know of. If you have set the separator as a String element in the Context, just access it directly. Now there will be an empty String set as the field separator I suppose.

    So if your field is called fileDelimiter simply put context.fileDelimiter into the Field Separator.