Talend CSV Fileoutput header option

One Star

Talend CSV Fileoutput header option

Job is:
SFDC->CSV Output
CSV output has Include Header option checked. Ideally this should create a header every time a file output is created. However, it is creating file with header only in case when the target file does not exist. If a file with the same name exists during time of run, it is just overwriting that file without the header.
TIS 5.1
Any suggestions how I can have the header row added every time I run, irrespective of the fact whether the target file exists or now.
Moderator

Re: Talend CSV Fileoutput header option

Hi, alfredo123
Thanks for your attention on Talend. In the CSV Output component, only the option "Include Header" for the setting of the head of your file. If you check it, you will get the header and check it on the output file and if not, you cannot see the head. The head row has been run every time and you can get the different head name as long as you change your schema in studio. If the last schema is same with the last, the head will be overwritten by the newest.
Hope it will help you !


Best Regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Talend CSV Fileoutput header option

Hi, alfredo123
Thanks for your attention on Talend. In the CSV Output component, only the option "Include Header" for the setting of the head of your file. If you check it, you will get the header and check it on the output file and if not, you cannot see the head. The head row has been run every time and you can get the different head name as long as you change your schema in studio. If the last schema is same with the last, the head will be overwritten by the newest.
Hope it will help you !

Sabrina,
no offense, but take some English courses. As a moderator you should be able to express what you want to say. I don't have the slightest idea what your text is supposed to mean. In the Rules section it is stated that the forum language is English and your text is... well, not really English.
And drop that silly "Thanks for your attention on Talend.", this is supposed to be a community forum not a support forum.
Bimmy
Community Manager

Re: Talend CSV Fileoutput header option

Hi alfredo123
If a file with the same name exists during time of run, it is just overwriting that file without the header.

I did't reproduce the problem as you described, I tested it in v5.1.1 and get the following situation:
If the file already exits, it overwrites the file including the file header, for example, here is a file with the contents:
id;name
1;shong
if I modify the job, output three columns of data to the file, and then it becomes:
id;name;age
2;talend;22
If I don't understand you well, can you please take an example to explain the problem?
Thank you!
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Talend CSV Fileoutput header option

Thanks for the reply Shong/Sabrina. I think Shong has understood my issue better.
In my case:
Source->CSV output file.
Scenario 1: Target file does not exist. I get the below output for filename abc.csv
id,name
1,shong
Scenario2: Rerun the same job, then output is as below:filename abc.csv
1,shong

Note no header in second output file even though I have the header option checked? Is this a bug?