Time for action – splitting the field to rows using Java

In this section, we will read the text file we read in the previous sections and we will split the line to rows using Java code.

  1. Create a new transformation and read the sample text file. In case you can't find the file, remember that its name is smcng10.txt and we used it for the first time in Chapter 4, Filtering, Searching, and Other Useful Operations with Data.

    Tip

    To save time, you can copy and paste the Text file input step from any of the other transformations that read the file.

  2. From the Scripting category, add a User Defined Java Class step and create a hop from the Text file input step toward this new step.
  3. Double-click on the UDJC step and type the following code:
    public boolean processRow(StepMetaInterface ...

Get Pentaho Data Integration Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.