This flat file has no header or trailer so only a body schema will be involved here. The next step is to identify the format of the record. Basically, this is a list of records delimited by CR LF. Observe that the field's data appears before the delimiter so the Child Order should be set to "Postfix" (see here).
Records are delimited by the string (| ) and not positional. Note that I included the space after the vertical bar to avoid getting an irrelevant space in the output. The child order should be "Prefix" (sequence is delimiter then data).
Every record has four fields. The first one and second one are left aligned, the third one is right aligned and the last one is left aligned. This allows to trim the spaces effectively. We have now all we need to build the schema for the flat file disassembler. Create a new schema in a BizTalk project and make sure you enable the Flat File Extension. Here is a representation of the schema and its properties, once designed:<Schema> Records Child Delimiter = 0x0D 0x0A, Type = Hexadecimal, Child Order = Postfix, Structure = Delimited Record Child Delimiter = | , Type = Character, Child Order = Prefix, Structure = Delimited Date Justification = Right String Justification = Left Num1 Justification = Right Num2 Justification = Right
To avoid rebuilding/deploying the schema all the time for the purpose of testing, BizTalk 2004 offers an utility called FFDAsm.exe. It is located in %BTSROOT%\SDK\Utilities\Pipelines. Here is one way to call it:FFDAsm schemaFlatFile.xsd -bs inputmessage.txt -c