Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Si4
Contributor II
Contributor II

[resolved] special characters in field names - CSV file using hyphen "-" header

Excuse the first time user question, but I have fallen at the first hurdle creating my first job.
The output CSV file needs specific header column names such as "first-name"; I cannot change this. When I define this in Talend it changes the field in the schema to "first_name" (underscore not hyphen) and i cannot seem to override or escape this.
Help.
Thanks
Si
Labels (3)
1 Solution

Accepted Solutions
Si4
Contributor II
Contributor II
Author

OK - searching further suggests that tUnite does not guarantee the field order on the output.
Change this to be a job for the header and a sub-job activated after the header job to append the data.
Sigh.
Si

View solution in original post

10 Replies
Anonymous
Not applicable

Hi
Talend don't support the special characters like hyphen "-" in the column name.
Best regards
Shong
Si4
Contributor II
Contributor II
Author

Thanks for the quick reply,
OK but then there must be a solution?
Lets say I put the header row in another file and then combine the output rows with that row to the output file - then I get the header coloumn names I want?
Cheers
Si
Si4
Contributor II
Contributor II
Author

OK - Now I have tried using tUnite to combine the data with a file containing the header row (with illegal characters) and that works fine except no matter how I set the tUnite merge order it always comes out the wrong way.
Any ideas what I am doing wrong?
Cheers
Si
Si4
Contributor II
Contributor II
Author

OK - searching further suggests that tUnite does not guarantee the field order on the output.
Change this to be a job for the header and a sub-job activated after the header job to append the data.
Sigh.
Si
Anonymous
Not applicable

Hi All,

 

 

Has this been solved yet? if not is there a workaround to inserting special characters into column names? my example:

"cost_centre_id" needs to be "cost-centre_id" but it is not letting me use it.

 

 

Please help.

 

Thanks,


John

Sriram151515
Contributor
Contributor

Hi All,

 

 

@Shicong Hong​ @si smith​ : Is there a solution identified for the above issue. Stuck with a requirement to use special characters in the column header eg: "attributes.name"

 

SJeshwani1618330394
Contributor
Contributor

Hi All,

 

Is there a workaround to inserting special characters into column names?

For example: location_latitude to location-latitude

 

gjeremy1617088143
Creator III
Creator III

Hi,you can create your file with a column name with non special characters,

then you read it with a tFileInputRaw as a unique String,

then you replace it ex : StringUtils.replace((your string),(the old column name),(the new one with special char))

finally you write it with tFileOutputRaw.

Send me Love and Kudos

dramirez29
Contributor
Contributor

What component do you use to replace?

tjava ?