×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Help with Schema

Help with Schema

Help with Schema

(OP)
Hi, another newbie here.
I'm having problems creating a schema for a positional/delimited text file.

Here is a sample:


"1....."
"2....."
"3....."
"4....."
"5....."
"8....."

The structure of this file is as follows:

a) Each line is 130 characters with 0x0D 0x0A at end
b) Each line is wrapped in "
c) Field 1 is the RecordTypeID and always 1 character
d) The remaining data is 127 characters and does not need to be further broken down (just a field named Data)
e) Each data file will have one record of RecordType 1 (the header)
f) Each data file will have one record of RecordType 8 (the footer)
g) Each data file will have at least one other type of record, could be many, could be 1.  not important, read on.

The goal is to append thousands of these files together, of course using different logic... WITH the exception that the resulting file will have ONLY 1 Header record and 1 Footer record.  In other words, append the inner data of thousands of files together.

I know my first step is to build a schema in BizTalk 2006 to actually read in a file.  This I can fine using the schema of

  ...
- <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="FixedFormat" />
  </xs:appinfo>
  </xs:annotation>
- <xs:element name="FixedFormat">
- <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 maxOccurs="unbounded" name="Items">
- <xs:annotation>
- <xs:appinfo>
  <b:recordInfo tag_name=""" structure="delimited" child_delimiter_type="char" child_delimiter=""" 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="Item">
- <xs:annotation>
- <xs:appinfo>
  <b:recordInfo structure="positional" 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="RecordTypeID" type="xs:int">
- <xs:annotation>
- <xs:appinfo>
  <b:fieldInfo justification="left" pos_offset="0" pos_length="1" sequence_number="1" />
  </xs:appinfo>
  </xs:annotation>
  </xs:element>
- <xs:element name="Data" type="xs:string">
- <xs:annotation>
- <xs:appinfo>
  <b:fieldInfo justification="left" pos_offset="0" pos_length="127" 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:schema>


I would like to have a schema that separates the header, inner items and footer, if possible.

Maybe I'm going about this the wrong way.  Don't know.

Any help would be appreciated.

Thanks.

RE: Help with Schema



You can use a custom pipeline and the Flat File Disassembler component where messages are parsed using header, trailer, and body schemas.

Use the Flat File Schema Wizard to create schemas.

Stew

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close