How to read a flat file with diferent fields

Hi Guys,

I have a flat file like this

00|000000001|1954321|2015-09-07|20:34:00|1
01|000000002|001
02|000000003|123|Item1|1000|12345678901|2015-09-07|00:00:00
98|000000004|3|1000
01|000000005|002
02|000000006|254|12345678901
98|000000007|3
99|000000008|8

The first 2 characters indicate the line's type. Lines starting with "01" indicate block headers, and "001", "002" is the identification of the block. Each block has different fields. I need a way to import this without to need break file in parts.

00 = Header File

02 = Item Content

98 = Footer Block

99 = Footer File

Does someone have

September 7th, 2015 7:54pm

Hi Samuel,

Need some more clarification, "Lines starting with "01" indicate block headers, and "001", "002" is the identification of the block."

1. Is there any value after 001, if yes then is it repeating value?

2. Can Item content repeat?

3. Is footer file is optional, because for block 001 footer file not present?

I have created schema with some input like below,

00|000000001|1954321|2015-09-07|20:34:00|1
01|000000002|001
02|000000003|123|Item1|1000|12345678901|2015-09-07|00:00:00
98|000000004|3|1000
99|000000008|8
01|000000005|002
02|000000006|254|12345678901
98|000000007|3
99|000000008|8

And generated schema below. Please verify. Do you want same schema. If Yes then it is simple to use Flat File Wizard and create schema. Refer 

Flat File Schema creation with Tag Identifiers in the input flat file repeating in a random fashion.

Walkthrough: Creating a Flat File Schema From a Document Instance

- <Root xmlns="http://FFProject.FlatFileSchema1">
- <HeaderFile xmlns="">
  <HeaderFile_Child1>000000001</HeaderFile_Child1> 
  <HeaderFile_Child2>1954321</HeaderFile_Child2> 
  <HeaderFile_Child3>2015-09-07</HeaderFile_Child3> 
  <HeaderFile_Child4>20:34:00</HeaderFile_Child4> 
  <HeaderFile_Child5>1</HeaderFile_Child5> 
  </HeaderFile>
- <HeaderBlock xmlns="">
  <HeaderBlock_Child1>000000002</HeaderBlock_Child1> 
  <HeaderBlock_Child2>001</HeaderBlock_Child2> 
  </HeaderBlock>
- <ItemContent xmlns="">
  <ItemContent_Child1>000000003</ItemContent_Child1> 
  <ItemContent_Child2>123</ItemContent_Child2> 
  <ItemContent_Child3>Item1</ItemContent_Child3> 
  <ItemContent_Child4>1000</ItemContent_Child4> 
  <ItemContent_Child5>12345678901</ItemContent_Child5> 
  <ItemContent_Child6>2015-09-07</ItemContent_Child6> 
  <ItemContent_Child7>00:00:00</ItemContent_Child7> 
  </ItemContent>
- <FooterBlock xmlns="">
  <FooterBlock_Child1>000000004</FooterBlock_Child1> 
  <FooterBlock_Child2>3</FooterBlock_Child2> 
  <FooterBlock_Child3>1000</FooterBlock_Child3> 
  </FooterBlock>
- <FooterFile xmlns="">
  <FooterFile_Child1>000000008</FooterFile_Child1> 
  <FooterFile_Child2>8</FooterFile_Child2> 
  </FooterFile>
  </Root>


Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 12:36am

Hi samuel,

Please find the below schema for the sample shared.

00 Header
01,02,98 is repeating records with optional fields (Details)
99 is Footer

This is my understanding,

Please check and let us know if our understanding is wrong - clarify with your inputs.

Copy the below and save as Schema.xsd

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
      <b:schemaInfo standard="Flat File" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Root" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Root">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:annotation>
          <xs:appinfo>
            <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
          </xs:appinfo>
        </xs:annotation>
        <xs:element name="Header">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Header_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo tag_name="00" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Header_Child1_Child1" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="1" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child2" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="2" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child3" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="3" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child4" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="4" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child5" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="5" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Record">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="Record_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Record_Child1_Child1">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="01" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child1_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child1_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Record_Child1_Child2">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="02" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child4" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="4" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child5" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="5" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child6" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="6" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child7" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="7" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Record_Child1_Child3">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="98" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Footer">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_order="infix" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Footer_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Footer_Child1_Child1">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="99" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element name="Footer_Child1_Child1_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Footer_Child1_Child1_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XML File, When you validate with the above schema.

<Root xmlns="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema">
	<Header xmlns="">
		<Header_Child1>
			<Header_Child1_Child1>000000001</Header_Child1_Child1>
			<Header_Child1_Child2>1954321</Header_Child1_Child2>
			<Header_Child1_Child3>2015-09-07</Header_Child1_Child3>
			<Header_Child1_Child4>20:34:00</Header_Child1_Child4>
			<Header_Child1_Child5>1</Header_Child1_Child5>
		</Header_Child1>
	</Header>
	<Record xmlns="">
		<Record_Child1>
			<Record_Child1_Child1>
				<Record_Child1_Child1_Child1>000000002</Record_Child1_Child1_Child1>
				<Record_Child1_Child1_Child2>001</Record_Child1_Child1_Child2>
			</Record_Child1_Child1>
			<Record_Child1_Child2>
				<Record_Child1_Child2_Child1>000000003</Record_Child1_Child2_Child1>
				<Record_Child1_Child2_Child2>123</Record_Child1_Child2_Child2>
				<Record_Child1_Child2_Child3>Item1</Record_Child1_Child2_Child3>
				<Record_Child1_Child2_Child4>1000</Record_Child1_Child2_Child4>
				<Record_Child1_Child2_Child5>12345678901</Record_Child1_Child2_Child5>
				<Record_Child1_Child2_Child6>2015-09-07</Record_Child1_Child2_Child6>
				<Record_Child1_Child2_Child7>00:00:00</Record_Child1_Child2_Child7>
			</Record_Child1_Child2>
			<Record_Child1_Child3>
				<Record_Child1_Child3_Child1>000000004</Record_Child1_Child3_Child1>
				<Record_Child1_Child3_Child2>3</Record_Child1_Child3_Child2>
				<Record_Child1_Child3_Child3>1000</Record_Child1_Child3_Child3>
			</Record_Child1_Child3>
		</Record_Child1>
		<Record_Child1>
			<Record_Child1_Child1>
				<Record_Child1_Child1_Child1>000000005</Record_Child1_Child1_Child1>
				<Record_Child1_Child1_Child2>002</Record_Child1_Child1_Child2>
			</Record_Child1_Child1>
			<Record_Child1_Child2>
				<Record_Child1_Child2_Child1>000000006</Record_Child1_Child2_Child1>
				<Record_Child1_Child2_Child2>254</Record_Child1_Child2_Child2>
				<Record_Child1_Child2_Child3>12345678901</Record_Child1_Child2_Child3>
			</Record_Child1_Child2>
			<Record_Child1_Child3>
				<Record_Child1_Child3_Child1>000000007</Record_Child1_Child3_Child1>
				<Record_Child1_Child3_Child2>3</Record_Child1_Child3_Child2>
			</Record_Child1_Child3>
		</Record_Child1>
	</Record>
	<Footer xmlns="">
		<Footer_Child1>
			<Footer_Child1_Child1>
				<Footer_Child1_Child1_Child1>000000008</Footer_Child1_Child1_Child1>
				<Footer_Child1_Child1_Child2>8</Footer_Child1_Child1_Child2>
			</Footer_Child1_Child1>
		</Footer_Child1>
	</Footer>
</Root>


Thanks, SMSVikasK

September 8th, 2015 1:45am

Does someone h
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 2:06am

Hi samuel,

Please find the below schema for the sample shared.

00 Header
01,02,98 is repeating records with optional fields (Details)
99 is Footer

This is my understanding,

Please check and let us know if our understanding is wrong - clarify with your inputs.

Copy the below and save as Schema.xsd

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
      <b:schemaInfo standard="Flat File" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Root" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Root">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:annotation>
          <xs:appinfo>
            <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
          </xs:appinfo>
        </xs:annotation>
        <xs:element name="Header">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Header_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo tag_name="00" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Header_Child1_Child1" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="1" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child2" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="2" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child3" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="3" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child4" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="4" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child5" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="5" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Record">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="Record_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Record_Child1_Child1">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="01" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child1_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child1_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Record_Child1_Child2">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="02" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child4" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="4" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child5" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="5" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child6" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="6" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child7" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="7" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Record_Child1_Child3">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="98" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Footer">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_order="infix" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Footer_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Footer_Child1_Child1">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="99" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element name="Footer_Child1_Child1_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Footer_Child1_Child1_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XML File, When you validate with the above schema.

<Root xmlns="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema">
	<Header xmlns="">
		<Header_Child1>
			<Header_Child1_Child1>000000001</Header_Child1_Child1>
			<Header_Child1_Child2>1954321</Header_Child1_Child2>
			<Header_Child1_Child3>2015-09-07</Header_Child1_Child3>
			<Header_Child1_Child4>20:34:00</Header_Child1_Child4>
			<Header_Child1_Child5>1</Header_Child1_Child5>
		</Header_Child1>
	</Header>
	<Record xmlns="">
		<Record_Child1>
			<Record_Child1_Child1>
				<Record_Child1_Child1_Child1>000000002</Record_Child1_Child1_Child1>
				<Record_Child1_Child1_Child2>001</Record_Child1_Child1_Child2>
			</Record_Child1_Child1>
			<Record_Child1_Child2>
				<Record_Child1_Child2_Child1>000000003</Record_Child1_Child2_Child1>
				<Record_Child1_Child2_Child2>123</Record_Child1_Child2_Child2>
				<Record_Child1_Child2_Child3>Item1</Record_Child1_Child2_Child3>
				<Record_Child1_Child2_Child4>1000</Record_Child1_Child2_Child4>
				<Record_Child1_Child2_Child5>12345678901</Record_Child1_Child2_Child5>
				<Record_Child1_Child2_Child6>2015-09-07</Record_Child1_Child2_Child6>
				<Record_Child1_Child2_Child7>00:00:00</Record_Child1_Child2_Child7>
			</Record_Child1_Child2>
			<Record_Child1_Child3>
				<Record_Child1_Child3_Child1>000000004</Record_Child1_Child3_Child1>
				<Record_Child1_Child3_Child2>3</Record_Child1_Child3_Child2>
				<Record_Child1_Child3_Child3>1000</Record_Child1_Child3_Child3>
			</Record_Child1_Child3>
		</Record_Child1>
		<Record_Child1>
			<Record_Child1_Child1>
				<Record_Child1_Child1_Child1>000000005</Record_Child1_Child1_Child1>
				<Record_Child1_Child1_Child2>002</Record_Child1_Child1_Child2>
			</Record_Child1_Child1>
			<Record_Child1_Child2>
				<Record_Child1_Child2_Child1>000000006</Record_Child1_Child2_Child1>
				<Record_Child1_Child2_Child2>254</Record_Child1_Child2_Child2>
				<Record_Child1_Child2_Child3>12345678901</Record_Child1_Child2_Child3>
			</Record_Child1_Child2>
			<Record_Child1_Child3>
				<Record_Child1_Child3_Child1>000000007</Record_Child1_Child3_Child1>
				<Record_Child1_Child3_Child2>3</Record_Child1_Child3_Child2>
			</Record_Child1_Child3>
		</Record_Child1>
	</Record>
	<Footer xmlns="">
		<Footer_Child1>
			<Footer_Child1_Child1>
				<Footer_Child1_Child1_Child1>000000008</Footer_Child1_Child1_Child1>
				<Footer_Child1_Child1_Child2>8</Footer_Child1_Child1_Child2>
			</Footer_Child1_Child1>
		</Footer_Child1>
	</Footer>
</Root>


Thanks, SMSVikasK

September 8th, 2015 5:44am

Hi samuel,

Please find the below schema for the sample shared.

00 Header
01,02,98 is repeating records with optional fields (Details)
99 is Footer

This is my understanding,

Please check and let us know if our understanding is wrong - clarify with your inputs.

Copy the below and save as Schema.xsd

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
      <b:schemaInfo standard="Flat File" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Root" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Root">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:annotation>
          <xs:appinfo>
            <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
          </xs:appinfo>
        </xs:annotation>
        <xs:element name="Header">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Header_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo tag_name="00" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Header_Child1_Child1" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="1" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child2" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="2" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child3" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="3" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child4" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="4" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                    <xs:element name="Header_Child1_Child5" type="xs:string">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:fieldInfo justification="left" sequence_number="5" />
                        </xs:appinfo>
                      </xs:annotation>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Record">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="Record_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Record_Child1_Child1">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="01" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child1_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child1_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Record_Child1_Child2">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="02" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child4" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="4" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child5" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="5" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child6" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="6" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child2_Child7" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="7" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Record_Child1_Child3">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="98" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element minOccurs="0" name="Record_Child1_Child3_Child3" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="3" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Footer">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="delimited" child_order="infix" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Footer_Child1">
                <xs:annotation>
                  <xs:appinfo>
                    <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                  </xs:appinfo>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:annotation>
                      <xs:appinfo>
                        <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                      </xs:appinfo>
                    </xs:annotation>
                    <xs:element name="Footer_Child1_Child1">
                      <xs:annotation>
                        <xs:appinfo>
                          <b:recordInfo tag_name="99" structure="delimited" child_delimiter_type="char" child_delimiter="|" child_order="prefix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                        </xs:appinfo>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:annotation>
                            <xs:appinfo>
                              <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                            </xs:appinfo>
                          </xs:annotation>
                          <xs:element name="Footer_Child1_Child1_Child1" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="1" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                          <xs:element name="Footer_Child1_Child1_Child2" type="xs:string">
                            <xs:annotation>
                              <xs:appinfo>
                                <b:fieldInfo justification="left" sequence_number="2" />
                              </xs:appinfo>
                            </xs:annotation>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XML File, When you validate with the above schema.

<Root xmlns="http://FourmPOC.SEP.x005F_x0030_9Sep2015.SepTwoFlatFileSchema">
	<Header xmlns="">
		<Header_Child1>
			<Header_Child1_Child1>000000001</Header_Child1_Child1>
			<Header_Child1_Child2>1954321</Header_Child1_Child2>
			<Header_Child1_Child3>2015-09-07</Header_Child1_Child3>
			<Header_Child1_Child4>20:34:00</Header_Child1_Child4>
			<Header_Child1_Child5>1</Header_Child1_Child5>
		</Header_Child1>
	</Header>
	<Record xmlns="">
		<Record_Child1>
			<Record_Child1_Child1>
				<Record_Child1_Child1_Child1>000000002</Record_Child1_Child1_Child1>
				<Record_Child1_Child1_Child2>001</Record_Child1_Child1_Child2>
			</Record_Child1_Child1>
			<Record_Child1_Child2>
				<Record_Child1_Child2_Child1>000000003</Record_Child1_Child2_Child1>
				<Record_Child1_Child2_Child2>123</Record_Child1_Child2_Child2>
				<Record_Child1_Child2_Child3>Item1</Record_Child1_Child2_Child3>
				<Record_Child1_Child2_Child4>1000</Record_Child1_Child2_Child4>
				<Record_Child1_Child2_Child5>12345678901</Record_Child1_Child2_Child5>
				<Record_Child1_Child2_Child6>2015-09-07</Record_Child1_Child2_Child6>
				<Record_Child1_Child2_Child7>00:00:00</Record_Child1_Child2_Child7>
			</Record_Child1_Child2>
			<Record_Child1_Child3>
				<Record_Child1_Child3_Child1>000000004</Record_Child1_Child3_Child1>
				<Record_Child1_Child3_Child2>3</Record_Child1_Child3_Child2>
				<Record_Child1_Child3_Child3>1000</Record_Child1_Child3_Child3>
			</Record_Child1_Child3>
		</Record_Child1>
		<Record_Child1>
			<Record_Child1_Child1>
				<Record_Child1_Child1_Child1>000000005</Record_Child1_Child1_Child1>
				<Record_Child1_Child1_Child2>002</Record_Child1_Child1_Child2>
			</Record_Child1_Child1>
			<Record_Child1_Child2>
				<Record_Child1_Child2_Child1>000000006</Record_Child1_Child2_Child1>
				<Record_Child1_Child2_Child2>254</Record_Child1_Child2_Child2>
				<Record_Child1_Child2_Child3>12345678901</Record_Child1_Child2_Child3>
			</Record_Child1_Child2>
			<Record_Child1_Child3>
				<Record_Child1_Child3_Child1>000000007</Record_Child1_Child3_Child1>
				<Record_Child1_Child3_Child2>3</Record_Child1_Child3_Child2>
			</Record_Child1_Child3>
		</Record_Child1>
	</Record>
	<Footer xmlns="">
		<Footer_Child1>
			<Footer_Child1_Child1>
				<Footer_Child1_Child1_Child1>000000008</Footer_Child1_Child1_Child1>
				<Footer_Child1_Child1_Child2>8</Footer_Child1_Child1_Child2>
			</Footer_Child1_Child1>
		</Footer_Child1>
	</Footer>
</Root>


Thanks, SMSVikasK

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 5:44am

Have you tried the Flat File Schema Wizard?

At one point, it asks if the likes have Tags.  00, 01, 02, 98 are all line tags.

September 8th, 2015 6:59am

Have you tried the Flat File Schema Wizard?

At one point, it asks if the likes have Tags.  00, 01, 02, 98 are all line tags.

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 10:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics