Modify flat records

When working on IEC flat files, there are instances when modifications are required before doing any IEC process. Here are some examples of what you can do:
  • Removing header records
  • Removing other unwanted records
  • Changing record separator
  • Removing garbage characters
  • Replacing non-XML characters

Typically, you must complete these modifications before the Split Redetect process or the FLAT to XML process.

When a flat file reaches the FLAT to XML process, the flat file should only conform to the message specification. All extra records, wrong record separators, garbage characters, and others that are created by different communication processes from the trading partner should be removed. Otherwise, you must remove or fix these items before converting flat file to XML.

Modifying Flat Record is a generic process that uses regular expressions. A basic to good knowledge of regular expressions is recommended to fully benefit from this process.

Modify Flat Record process

The process Modify Flat Record has two properties and one or more Strip/Replacement steps that you must configure. Use the properties Record Separator and Max Record Length to define the records. Use the Strip/Replacement steps to define what to do with the records, that is to strip or remove them, or to modify them in some way.

For more information, see Javadoc for the class Pattern: http://java.sun.com/j2se/1.5/docs/api/java/util/regex/Pattern.html.

The process reads records from the persisted (input) file one at a time. Each record is processed by all Strip/Replacement steps in the defined order and then written to the output file. You can handle large files without risk of high memory consumption.