I am trying to create a delimited flat file schema that takes care of the following file format:
"ID","Surname","FirstName"{CR}{LF}
"FINAL","123","abc"{CR}{LF}
The above is just one record. The row beginning with "FINAL" is an optional row.
Multiple records in a file can look like:
"ID","Surname","FirstName"{CR}{LF}
"FINAL","123","abc"{CR}{LF}
"ID","Surname","FirstName"{CR}{LF}
"FINAL","456","def"{CR}{LF}
Or, it can also look like the following:
"ID","Surname","FirstName"{CR}{LF}
"ID","Surname","FirstName"{CR}{LF}
"FINAL","123","abc"{CR}{LF}
The final example above contains one record without the optional "FINAL" row, and continues on with the new record right below it. However in this case I get an error (Reason: Unmatched wrap character " ).
I have noticed that if the file contains a {CR}{LF} in place of the missing optional "FINAL" row like the following:
"ID","Surname","FirstName"{CR}{LF}
{CR}{LF}
"ID","Surname","FirstName"{CR}{LF}
"FINAL","123","abc"{CR}{LF}
it seems to work, however I will be receiving files without any extra {CR}{LF} in place of the missing optional row.
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.
I would use a Choice Group with Tag Identifier