Skip to main content

Functions

To use column name as space/numbers/special characters in output file using Talend

Featurelatest

Problem Statement:

In Talend, while generating output file if we need to add a column as number or column name with space or to include any special characters as column name in Talend it won’t allow directly by adding the above-mentioned column names in schema, will get the below mentioned error.

As number as column name:

Capture    Capture2

As space in column name:

Spacecolumn Spacecolumnerror

As special characters in column name:

Specialcharatererror      Specialcharater

Solution:

The above use case was implemented by simple Talend job and with the below steps.

Step 1: To use tFixedFlowInput component by providing the actual column names (number/special character/space) as highlighted below,

Columndefining Step 2: To map the fields to the target file to populate the headers in the first line of the output.

Output1

Step 3: To load the actual source data which we need to load it in output target file will be done in step 3. The source data can be a Input File or any other stream of data. Here input file is used as a source for example.

Step3input

Step 4: In order to avoid the header from actual file used and to pick the headers from the previous flow we need to use sequence and given condition to pick the records which has sequence more than the value 1 as below in tMap.

Tmap

Step 5: To load the source data after tMap to the same target file using append operation on addition to the header load from the previous flow.

Outputfile

with the same concept we can replace the output component instead of tFileOutputDelimited to tFileOutputExcel for generating excel.

Result:

The output file is generated after the execution of the job and the given columns are loaded successfully as below in header of the target file.

Outresult

 

Leave a Reply

Your email address will not be published. Required fields are marked *

https://www.google.com/recaptcha/api.js?ver=1.23

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Gowsalya Arumugapandian

Gowsalya Arumugapandian is a technical consultant at Perficient. She is a Talend Developer with four years of experience and expertise in Talend ESB, data integration, and data transformation under the ETL process.

More from this Author

Follow Us