• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » tFileOutputDelimited with 2 line custom header

#1 2012-06-27 22:20:48

wesleychristelis
Member
Registered: 2012-06-15
Posts: 31

tFileOutputDelimited with 2 line custom header

Hi

when populating a delimited file from a DB , i can choose that it include  HEADER...

how do i create said output with my own 2 line header , with my relevant details .

and then bring in my data

Regards

============================================================================

example:

FILTYPE00001-as7vlkdf9923j-kljsda89823m-20110637051002         //HEADER line 1 - file information i.e. file type , guid , date
#data1~data~data3                                                                    //HEADER line 2 - same as header but starts with #

data1~data2~data3                                                                     //row1 from data DB
data1~data2~data3                                                                     //row2 from data DB
data1~data2~data3                                                                     //row3 from data DB


============================================================================

Last edited by wesleychristelis (2012-06-27 22:26:59)

Offline

#2 2012-06-28 05:33:53

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tFileOutputDelimited with 2 line custom header

Hi

A workaround is to load these 2 line header first into one output delimited file and then load other rows by selecting "append" option on tFileOutputDelimited.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-06-28 12:35:05

wesleychristelis
Member
Registered: 2012-06-15
Posts: 31

Re: tFileOutputDelimited with 2 line custom header

Hi Pedro

sorry still new to talend

I understand the concept what component do i use to populate the file withe the header

as the first line of the header has a string describing filetype , then i insert a GUID and getDate() for the date

(i used String newGUID = java.util.UUID.randomUUID().toString() to generate and assigned it as global, using globalMap.put("GUID",newGUID)

the second line being the schema data header bu prefixed with #.

could you elaborate :

i am trying the following , see screen shots


and pass that to my first output file ... but no luck


Uploaded Images

Last edited by wesleychristelis (2012-06-28 12:42:54)

Offline

#4 2012-06-29 07:37:33

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tFileOutputDelimited with 2 line custom header

Hi

The error is because tJavaFlex cannot link tFileInputDelimited.

You might create a job as the following image.
There is no need to use tJavaFlex here.

Regards,
Pedro


Uploaded Images


Only Paranoid Survive.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » tFileOutputDelimited with 2 line custom header

Board footer

Powered by FluxBB