One approach to consider:
- Structure things to just ignore the first record. Presumably you’re using a REPEAT so you can tell which iteration you’re on.
- To detect the trailer record there is likely a field that can be checked for the presence of a value. Regex of /\S/ may work for your case. If a detail field always has it and the trailer never does then that can be your signal that you’ve reached the end.
I assume the header and trailer are padded to the record length so that all records are the same length. If not, that may present challenges.
Another possible approach:
- Open the file and read the stream yourself to move the file pointer passed the first record.
- Call convertToValues as needed.
- If convertToValues fails in a specific way for the trailer record, you can catch that and ignore it.
HTH
#webMethods#Integration-Server-and-ESB#flat-file