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

Creating and writing files depending on the input data

Sometimes it is required that multiple files are written from a single data source where the file name is dependent upon the data held within the row. This recipe shows how this can be achieved.

Getting ready

Open the jo_cook_ch08_0140_filesFromInputData job.

How to do it...

The steps for creating and writing files depending on the input data are as follows:

  1. Run the job, and you will see that the file dummy.txt has been created and populated with six rows.
  2. Open the tJavaRow component, and you will see that the move of data from input to output has already been performed.
  3. Add in the following code after the generated code:
    // test for change of input_row.key if (Numeric.sequence(input_row.key, 1, 1) ...

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