title: BizTalk Flat File Schema with optional last child record
body: <p>I am trying to create a delimited flat file schema that takes care of the following file format:</p>
  <pre><code>&quot;ID&quot;,&quot;Surname&quot;,&quot;FirstName&quot;{CR}{LF}
  &quot;FINAL&quot;,&quot;123&quot;,&quot;abc&quot;{CR}{LF}
  </code></pre>
  <p>The above is just one record. The row beginning with &quot;FINAL&quot; is an optional row.</p>
  <p>Multiple records in a file can look like:</p>
  <pre><code>&quot;ID&quot;,&quot;Surname&quot;,&quot;FirstName&quot;{CR}{LF}
  &quot;FINAL&quot;,&quot;123&quot;,&quot;abc&quot;{CR}{LF}
  &quot;ID&quot;,&quot;Surname&quot;,&quot;FirstName&quot;{CR}{LF}
  &quot;FINAL&quot;,&quot;456&quot;,&quot;def&quot;{CR}{LF}
  </code></pre>
  <p>Or, it can also look like the following:</p>
  <pre><code>&quot;ID&quot;,&quot;Surname&quot;,&quot;FirstName&quot;{CR}{LF}
  &quot;ID&quot;,&quot;Surname&quot;,&quot;FirstName&quot;{CR}{LF}
  &quot;FINAL&quot;,&quot;123&quot;,&quot;abc&quot;{CR}{LF}
  </code></pre>
  <p>The final example above contains one record without the optional &quot;FINAL&quot; row, and continues on with the new record right below it. However in this case I get an error (Reason: Unmatched wrap character &quot; ).</p>
  <p>I have noticed that if the file contains a {CR}{LF} in place of the missing optional &quot;FINAL&quot; row like the following:</p>
  <pre><code>&quot;ID&quot;,&quot;Surname&quot;,&quot;FirstName&quot;{CR}{LF}
  {CR}{LF}
  &quot;ID&quot;,&quot;Surname&quot;,&quot;FirstName&quot;{CR}{LF}
  &quot;FINAL&quot;,&quot;123&quot;,&quot;abc&quot;{CR}{LF}
  </code></pre>
  <p>it seems to work, however I will be receiving files without any extra {CR}{LF} in place of the missing optional row.</p>
  <p>Is there a property in the schema that I need to set to take care of this? MinOccurs for the optional child record is set to 0.</p>