Text File Output
Output text files ..

Append streams
Use Append streams when order matters. It outputs all rows from the first hop. It then outputs all rows from the second hop.
Both input streams must have the same field names and types.
Drag Append streams onto the canvas.
Create hops from User Defined Java Expression and Data Grid.
Double-click the step. Configure it like this:

Select OK.
Text file input
Use Text file input to read the question list from a file. Each question becomes one row.
Drag Text file input onto the canvas.
Double-click the step. Configure it like this:

File: ${Internal.Transformation.Filename.Directory}/questions.txt

On Fields, rename the output field to
text:

Select OK.
User Defined Java Expression
Use a second User Defined Java Expression to prefix each question line with its question number.
Drag User Defined Java Expression onto the canvas.
Create a hop from Text file input (questions).
Double-click the step. Configure it like this:

Select OK.
Select values
The Select Values step is useful for selecting, removing, renaming, changing data types and configuring the length and precision of the fields on the stream.
These operations are organized into different categories:
Select and Alter — Specify the exact order and name in which the fields should be placed in the output rows
Remove — Specify the fields that should be removed from the output rows
Meta-data — Change the name, type, length, and precision (the metadata) of one or more fields
Drag Select values onto the canvas.
Create a hop from User Defined Java Expression (number questions).
Double-click the step. Configure it like this:

Select OK.
Drag Text file output onto the canvas.
Create a hop from Append streams (body).
Double-click the step. Set the file name:
Filename: ${Internal.Transformation.Filename.Directory}/survey

On Fields, select Get Fields.

Select OK.
Last updated
Was this helpful?







