Reading headers and trailers with no identifiers
This recipe shows how to parse a file that has header and trailer records, but does not have an associated record type. Instead, the header is the first record in the file, and the trailer is the last record in the file.
Getting ready
Open the jo_cook_ch08_0070_headTrailtMapNoType
job. You will see that it is a slightly changed version of the completed job from the previous recipe; the output schemas have changed.
How to do it...
The steps for reading headers and trailers with no identifiers are as follows:
Drag a
tFileRowCount
component onto the canvas.Open the
tFileRowCount
, and change File Name tocontext.cookbookData+"/chapter8/chapter08_jo_0070_customerData.txt"
, which is the same as our input file.Connect an
onSubJobOk
trigger from thetFileRowCount
component to thetFileInputDelimited
.Open the
tMap
, and add a new variablerowCount
. Set its expression toNumeric.sequence("rowNumber",1,1)
.Change the Filter expressions for header, detail, and...