This recipe shows how to parse a file that has header and trailer records, and a record type at the start of a line.
The steps for reading headers and trailers using tMap
are as follows:
Drag a
tMap
component onto the canvas.Connect the
tFileInputFullRow
totMap,
and rename the flow tocustomerIn
.Open
tMap,
and create three new outputs. Name themheader
,detail
, andtrailer
.Copy the input field line into each of the new outputs.
Add the expression filter
customerIn.line.startsWith("00")
to the header output table.Add the expression filter
customerIn.line.startsWith("01")
to the detail output table.Add the expression filter
customerIn.line.startsWith("99")
to the trailer output table.Close
tMap,
and drag threetExtractDelimitedFields
components to the canvas, along with threetLogRow
components.Join each output from
tMap
to each...