Flat File Messages with Delimited Records

Delimited records within a flat file instance message contain nested records and/or individual fields (items of data) that are separated by a predefined character or set of characters. The fields are parsed according to these separating delimiters. For example, consider the following delimited records from a flat file instance message, which contain two line items from a hypothetical purchase order:

  
ITEMS,ITEM872-AA|Lawnmower|1|148.95|Electric-120vac,ITEM926-AA|Baby Monitor|1|39.98|Electric-4AA|2004-01-21  
  

A reasonable definition for this record in a flat file schema can be described as follows:

  • A delimited record named items with child delimiter (,), child order prefix, and the tag ITEMS.

    • A delimited, repeating record named item with child delimiter |, child order infix, and the tag ITEM.

    • An attribute named "partNum".

    • An element named "productName".

    • An element named "quantity".

    • An element named "USPrice".

    • An element named "powerSource".

  • An optional element named "shipDate".

    Given these record and field definitions, the flat file disassembler produces the following XML equivalent of these records.

  
<items>  
    <item partNum="872-AA">  
        <productName>Lawnmower</productName>  
        <quantity>1</quantity>  
        <USPrice>148.95</USPrice>  
        <powerSource>Electric-120vac</powerSource>  
    </item>  
    <item partNum="926-AA">  
        <productName>Baby Monitor</productName>  
        <quantity>1</quantity>  
        <USPrice>39.98</USPrice>  
        <powerSource>Electric-4AA</powerSource>  
        <shipDate>2004-01-21</shipDate>  
    </item>  
</items>  
  

There are a number of considerations related to delimited records that will affect how the record is parsed when received and constructed when sent, including:

Note

If your flat file contains both delimited and positional records, you must set the Structure property of the root node to Delimited and the Structure property of subordinate record nodes to either Delimited or Positional as appropriate.

Note

Delimited fields in flat files have a limit of 50000000 characters.

See Also

Structure of a Flat File Message
How to Create Schemas for Flat File Messages
Migrating Flat File Records