Outputting data to files
Creating and populating files with data is another common requirement in ETL processes. This section is meant to teach you how to do this with PDI.
Creating a simple file
As well as taking data from several types of files, PDI is capable of sending data to different types of output files. All you have to do is redirect the flow of data towards the proper output step.
As a starting point, we will demonstrate how to generate a plain text file. In this case, we will generate a file with dates:
- From the code in Chapter 2, Getting Started with Transformations open the Transformation that generates dates,
date_range.ktr
. Save it under a different name.
- Double-click the second
Calculator
step. We will use this step for adding more fields related to each date. Fill the grid as follows:
Adding fields in a Calculator step
- Expand the
Output
branch of theSteps
tree, look for theText file output
step and drag it to the work area. - Create a hop from the
Calculator
step to this new step...