Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Problems parsing "simple" flatfile (Error 80131940)
- This topic has 9 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
November 6, 2007 at 8:06 AM #18336
Hello,
I am having difficulties parsing a comma delimited flatfile with a header and footer. A little complication is that there's a blank line in between records. I have tried 1 schema with header, body and footer, and also 3 different schemas one for each but still get error 80131940 at the end.
Here is a sample of this flatfile:
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,
04/18/1999,134719042,Bought 2 AOL @ 142,2,AOL,142.00,8.00,-292.00,
04/18/1999,134719103,Bought 5 LU @ 56.875,5,LU,56.875,8.00,-292.38,
***END OF FILE***
——
Thanks in advance.
AntonioL
-
November 6, 2007 at 8:24 AM #18337
What is the error you are getting?
If the problem is the blank line between each record you could try changing your delimiter to being a double (linefeed and a new line) … don't quite know the hex off by heart.
Have you tried using the Flat File wizard in Bts 2006? It is really very good and thus far I have not had many flat files that I have been unable to use; even some very complex ones.
-
November 6, 2007 at 8:46 AM #18338
I don't have the exact error message but I remember it mentioned something along the lines of 'error before processing /r/r' and then it did show the error # 80131940.
I am already using a double linefeed (0x0A) as a delimiter.
The schema for the body was generated using BTS's wizard.
Thanks,
AntonioL
-
November 6, 2007 at 10:10 AM #18339
What's the syntax of your delimiter?
0x0A,0x0A
or
0x0A 0x0A
or
0x0A;0x0A
I can't remember off the top of my head how to specify 2 hex values for the delimiter, but if not done correctly it won't work, even though your logic is correct.
-
November 6, 2007 at 10:56 AM #18340
The syntax is 0x0A 0x0A. This part was done with the wizard by the way.
-
November 6, 2007 at 11:05 AM #18341
Are you accounting for the comma at the end of each line? Normally you wouldn't have a comma at the end of a line unless there is a blank field at the end of each record. I'm thinking your delimited may need to be:
0x2C 0x0A 0x0A
If your schema only has 9 records than the last comma has to be part of the delimiter.
-
November 6, 2007 at 11:20 AM #18342
Yes, I took it into account. The last comma is the delimiter before "SALES FEE" (9th. field) which happens to be empty in this sample.
-
November 6, 2007 at 11:27 AM #18343
Can you post your schema?
There are a number of other things it could be and going back and forth it time consuming 🙂
-
November 6, 2007 at 11:40 AM #18344
Thanks for taking the on this.
The header schema is:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Ameritrade_History.StockTransactionHeader" targetNamespace="http://Ameritrade_History.StockTransactionHeader" 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="Header" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Header">
<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="Header_Child1" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" pos_offset="0" pos_length="81" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>The body:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Microsoft.Samples.BizTalk.FlatFileReceive.StockTransactionSchema" targetNamespace="http://Microsoft.Samples.BizTalk.FlatFileReceive.StockTransactionSchema" 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="true" early_terminate_optional_fields="true" allow_message_breakup_of_infix_root="true" compile_parse_tables="false" root_reference="StockTransactions" />
</xs:appinfo>
</xs:annotation>
<xs:element name="StockTransactions">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xA 0xA" 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 maxOccurs="unbounded" name="IndividualTransaction">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," 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="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>The footer:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Ameritrade_History.StockTransactionFooter" targetNamespace="http://Ameritrade_History.StockTransactionFooter" 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="Footer" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Footer">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="hex" child_delimiter="0x0A 0x0A" 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 maxOccurs="1" name="Footer_Child1" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" pos_offset="0" pos_length="17" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>—-
AntonioL
-
November 6, 2007 at 3:32 PM #18351
I've been trying to post the schemas for this problem; however, it says that this forum has a moderator. So hopefully they'll eventually show up.
Thanks for your time.
AntonioL.
-
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.