Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Still having problems parsing a flat file
- This topic has 2 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
November 10, 2007 at 11:14 AM #18386
I am having problems parsing a simple flatfile (header, body & footer) in a pipeline. I created a schema that validates OK in Visual Studio; however, it bombs when I test it using ffdasm.exe.
Sample file:
DATE,TRANSACTION ID,DESCRIPTION,QUANTITY,SYMBOL,PRICE,COMMISSION,AMOUNT,SALES FEE
04/06/1999,129052251,CASH RECEIPT,,,,,3000.00,
04/18/1999,134718619,Bought 7 DELL @ 38.9375,7,DELL,38.9375,8.00,-280.56,
04/18/1999,134718735,Bought 3 CSCO @ 106.5,3,CSCO,106.50,8.00,-327.50,
04/18/1999,134718771,Bought 3 KSS @ 74.4375,3,KSS,74.4375,8.00,-231.31,
09/14/1999,196147464,DIVIDEND OR INTEREST (IP),,IP,,,1.00,
***END OF FILE***
Schema:
<?xml version=”1.0″ encoding=”utf-16″?>
<xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003″ xmlns=”http://Microsoft.Samples.BizTalk.FlatFileReceive.StockTransactionAll” targetNamespace=”http://Microsoft.Samples.BizTalk.FlatFileReceive.StockTransactionAll” 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” 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=”base” child_delimiter_type=”hex” default_child_delimiter=”0x0A 0x0A” default_child_order=”postfix” />
</xs:appinfo>
</xs:annotation>
<xs:element name=”base”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo sequence_number=”1″ structure=”delimited” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” child_delimiter_type=”default” child_order=”default” />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=”0″ />
</xs:appinfo>
</xs:annotation>
<xs:element name=”header”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure=”positional” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” sequence_number=”1″ />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number=”0″ />
</xs:appinfo>
</xs:annotation>
<xs:element name=”discard_header” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo sequence_number=”1″ justification=”left” pos_length=”81″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs=”unbounded” name=”IndividualTransaction”>
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure=”delimited” child_delimiter_type=”char” child_delimiter=”,” preserve_delimiter_for_empty_data=”true” suppress_trailing_delimiters=”false” sequence_number=”2″ child_order=”infix” />
</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=”am_Date” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”1″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_TransactionId” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”2″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_Description” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”3″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_Quantity” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”4″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_Symbol” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”5″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_Price” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”6″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_Commission” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”7″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_Amount” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”8″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name=”am_SalesFee” type=”xs:string”>
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification=”left” sequence_number=”9″ />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>Error:
C:\Program Files\Microsoft BizTalk Server 2006\SDK\Utilities\PipelineToo
ls>ffdas
m TestData\transactions1.txt -bs TestData\StockTransactionAll.xsd -v
Creating objects.
Creating message.
Adding message to a pipeline.
Executing pipeline.
Getting processed message(s).
Doing output for a message 1.Error
Source: Flat file disassembler
Message: Unexpected end of stream while looking for:
‘\n\n’
The current definition being parsed is base. The stream offset where the error o
ccured is 1530. The line number where the error occured is 48. The column where
the error occured is 0.
HRESULT: 80131940Any help from the gurus would be appreciated.Thanks,antoniolozada -
November 13, 2007 at 1:59 PM #18407
Did you really mean to have your child delimiter set to 0x0A 0x0A? If you’re receiving a DOS file, you’d probably want your child delimiter set to 0x0D 0x0A.
-
November 15, 2007 at 4:50 PM #18438
I have no choice since that’s the format passed by the provider of those files.
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.