Flat file message structures

Records or group of records contained in flat files define the structure of a message. Every record is specified in a single line and consists of a special sequence of fields. The sequence of fields in a record is defined as having a number of occurrences.

The first row in a flat file refers to the field name. Fields are separated by comma, records are separated with a line feed character (UNIX style), or a combination of line feed and carriage return character (Windows style). Flat files that include comma as delimiters help ensure fixed-width data formatting, also called comma separated value (CSV) file.

Example 1, six records separated by a line break

The fields in each record are separated by a comma. The third and fourth records are two occurrences of the same type of record which are structured in exactly the same way.

DHDR,JSA EENMI567,Blueberryhills Technologies;222-555-1234EENMAM98329A0176643002200011796V4000230,DAVID JONES CO;C011000209485456-145RM IV23456,41796RM IV2345,-30000CM,CREDIT MEMO ADJUSTMENTA0425577710000110316V40000004,SOFTBANK

Example 2, a record that uses extra formatting to avoid separator confusion

If you use a separator without its special meaning, use an escape sequence consisting of a string of characters. When it precedes a separator, an escape sequence has the effect of negating the separator’s special meaning. The escape sequence forward slash "/" is used to parse fields.

This field has a comma/,that needs to be escaped,this is another field,

Example 3, a record that uses an identifier

The first field in the record is defined as an identifier which allows the enclosing records’ signature to separate from other records in the message.

Order,39827483927,03982409238,02384902