O'Reilly logo

Talend Open Studio Cookbook by Rick Barton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a header and trailer to a file

This recipe details a method for creating a file with a header and trailer record, which makes use of file append.

Getting ready

Open the jo_cook_ch08_0090_createHeaderAndTrailer job.

How to do it...

The steps for adding a header and trailer to a file are as follows:

  1. Open the tFixedFlowInput_1 component.
  2. Add the following for the field fileDate; TalendDate.getDate("CCYY-MM-DD").
  3. Open the tFixedFlowInput_2 component.
  4. Add the following for the field fileDate; ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")).
  5. Open tFileOutputDelimited_1, and change the type to Append.
  6. Open tFileOutputDelimited_4, and change the type to Append.
  7. Run the job, and if you examine the output file, you should see that it has created a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required