adding a header to a file

One Star

adding a header to a file

is it possible to add a header to an tFileOutputDelimited from a tMap, so that it appears at the top of the file only once and the rest of the rows are just appended on?
One Star

Re: adding a header to a file

In which version are you?
In 2.3 and 2.4, the Basic settings of the tFileOutputDelimited have an option : "Include header", check this and you will have an header in the file.....
Was it your question?
I hope it's help you.
P.S : You will find screenshot of this component in the manual.
One Star

Re: adding a header to a file

I have seen this checkbox alright. I am using version 2.4, where can I set this header value that appaers to be the problem i dont see anywhere where i can set this header value to be some string entered by myself....?!
One Star

Re: adding a header to a file

look at the screenshot, is it help you?
One Star

Re: adding a header to a file

hi olivier, thanks for the help.
I know where it is, I want to include a header in teh file, but i want to be able set the value of this header somewhere in talend, is that possible?!?!
One Star

Re: adding a header to a file

by default, it's the name of columns... Change the names by editing the schema or by changing them in the tMap (at the right of the tMap), it will propagate the news names to the tFile and you will have the header you want. Is that your question?
One Star

Re: adding a header to a file

Yes i want to be able set that value somewhere but i dont want it to be the column name, and i want it to be a sting of about 255 characters, so I dont think this will suffice..... is there any other way of doing it?
One Star

Re: adding a header to a file

the string that i want to change it to will have the newline character etc in it along with spaces, surely there is a simple way to set the header of the file to a string of some value?!
One Star

Re: adding a header to a file

Can you post a screenshot of the part of your job.
If I understood what you want :
You want to add a column after your tMap in the file that results of the tMap? So your file have a column more than the the fields in the tMap????
You can define the schema of the file "globally" in the metada part (at the left of TOS, in the repository window), then you select "repository" instead of "built-in" for the schema of the file in the tFileOutputDelimited component basic settings tab.....
In the metadata, you define the file you want to have with the column (type = string).... and in the tMap, you can file-in this column with the value you want (like a constant = "your_text"????)....
Five Stars

Re: adding a header to a file

Indigo,
You basically just want to append a line at the top of your output file, but above the header... Kinda like:

***** This is output was created 7/3/2008 @ 13:45 EST *****
Department || DeptID
EH&S || 1000
ENGINEERING || 1001
MAINTENANCE || 1002
Manufacturing || 1003

Maybe you can use RowGenerator to just create a single line, write out to that file first, then write your data out to the same file as an append?
- Brian
One Star

Re: adding a header to a file

hi briansms, that sounds like a good idea, will row generater let me add any piece of text that i want to the file? if so can i run the two jobs parrallel then or does it really matter? cos obviouslly i need to add the row ( with the hardcoded string) first before i append the output from the tMap to the file.

my job currently looks like this:
fileInput -> tMap -> fileOutputDelimited
but i assume i need to run something like:
fileInput -> tMap -> fileOutputDelimited
rowGenerator -> fileOutputDelimited
Five Stars

Re: adding a header to a file

Hi Indigo,
I haven't tried it yet myself, but since you want the text to appear at the top, I'd think you'd have to do something like this:
rowGenerator -> fileOutputDelimited
|
|
OnSubjobOk
|
|
fileInput -> tMap -> fileOutputDelimited

I'll be gone a few days, so won't be able to try it myself until next week.
- Brian