Skip to main content

Functions

Use Column Name as space/numbers/special Characters in Output File Using Talend

Developers Guide To Custom Datasource For Dropdown Fields In Context-Aware Configuration Editor

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 below-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 *

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