Using BizTalk to parse a flat file with one line header and one line trailer, but unknown number of detail records

Hi,

I'm very new to BizTalk.  I'm currently on BTS20013R2, and I need to parse a csv file similar to the following:

"00000000","0400","20150112","20140101","20150112"
"00102445","20140102","60934N625   ","PCOXX       ","FEDERATED MMKT PRIME OBLG FUND #851 ","+000000000000"
"00102445","20140103","60934N625   ","PCOXX       ","FEDERATED MMKT PRIME OBLG FUND #851 ","+000001902700"
"00105047","20140104","60934N625   ","PCOXX       ","FEDERATED MMKT PRIME OBLG FUND #341 ","+000001565700"
"999999999999","000000000098"

The first line is the header, last line is the trailer, between is the repeating body.  Fields are separated by commas and the contents are wrapped by double quotes.  Using Flat File Schema Wizards,  I created a header schema for the first line (a single record with 5 fields), a trailer schema for the last line (a single record with 2 fields) and a body schema for the repeating records in between (repeating record with 6 fields).  The wrap character type is "Character" and wrap character is a double quotes. A ReceivePipeline was used to specify all the schemas. Unfortunately there was no tag in this case to indicate the repeating body.  When I run my app, I got an error similar to: Unexpected data found while looking for: ',' at line 5.  I would really appreciate it if any one could point out what I did wrong here or better yet could give me an example based on my data.

Many thanks,

Jack

February 17th, 2015 5:08pm

all the schemas. Unfortunately there was no tag in this case to indicate the repeating body.  When I run my app, I got an error similar to: Unexpected data found while looking for: ',' at line 5.  I would really appreciate it if any one could point out what I did wrong here or better yet could give me an example based on my data.

Please post the full error message, we can look into it further.
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 2:12am

Probably you can use the first field of the trailer record ("999999999999") as a tag, to identify that line as the trailer. I say probably because we don't know what those numbers represent.

It's probably easiest if you run the flat file schema wizard again, and mark that field as a tag.

February 18th, 2015 2:28am

Probably you can use the first field of the trailer record ("999999999999") as a tag, to identify that line as the trailer. I say probably because we don't know what those numbers represent.

It's probably easiest if you run the flat file schema wizard again, and mark that field as a tag.

Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 7:25am

Probably you can use the first field of the trailer record ("999999999999") as a tag, to identify that line as the trailer. I say probably because we don't know what those numbers represent.

It's probably easiest if you run the flat file schema wizard again, and mark that field as a tag.

February 18th, 2015 7:25am

Probably you can use the first field of the trailer record ("999999999999") as a tag, to identify that line as the trailer. I say probably because we don't know what those numbers represent.

It's probably easiest if you run the flat file schema wizard again, and mark that field as a tag.

Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 7:25am

Hi Peter & Angie,

To make things easier, I have a new csv file as following:

East Coast Facility
16500|0|High|Sprocket query fails.|1999-05-31T13:20:00.000-05:00
16501|1|Low|"Time threshold exceeded..."|1999-05-31T13:20:00.000-05:00
16502|2|Medium|"Time threshold exceeded.--"|1999-05-31T13:20:00.000-05:00
16503|3|Extremely High|Time threshold exceeded.++|1999-05-31T13:20:00.000-05:00
16504|4|Extremely High|"test"|1999-05-31T13:20:00.000-05:00
TRAILER99999|0005

Here I marked the trailer with a tag "TRAILER" and specified that in my trailer schema.  but when I run FFDasm, I'm still getting an error on parsing the body, not the trailer. I'd like to attach my project but it seemed no such option here.  If you'd like to try it, I'm more than happy to email it to you.  The error says "unexpected data found while looking for "|" " when processing body record on line 7 (which is really the trailer).  The first line is the header.

Please advice.

Thanks,

Jack

February 27th, 2015 7:02pm

Hi Jack,

Problem with your schema which you have shown now (second one) is body doesnt have a tag identifier.

So whats happening in your case when the flat-file disassembler parsed is:.

  • For the first line the header schema is used. Since its a single line, so the first line is parsed for header schema.
  • Then, the body schema is used for parsing the rest of the flat-file. Since the body lines don't have tag identifiers, disassembler will continue to parse the repeating records, this includes parsing the last line, which is the trailer. The actual problem is disassembler doesn't know when to stop parsing for body lines
  • The error says that flat-file disassembler doesnt able to find  "|" after 005 as this is not supposed to be in the trailer line but the flat-file disassemblers body schema doesnt know when to stop parsing.

So the correct flat-file schema should have tag identifier for body so that it can be parsed.

But there is work around for this issue, which I would suggest to read from this blog post.

http://blog.eliasen.dk/CommentView,guid,31a59f27-a350-4325-987d-94b3da075f35.aspx

Now you shall also understand why you were getting similar error for your first schema where you dont have any tag identifier for body and you were getting similar error because of the same reason as explained above.

Hope this helps.

Regards,

M.R.Ashwin Prabhu

Free Windows Admin Tool Kit Click here and download it now
February 27th, 2015 8:27pm

Many thanks, that worked!
  • Marked as answer by selits19 Tuesday, March 03, 2015 8:58 PM
  • Edited by selits19 Tuesday, March 03, 2015 9:19 PM
March 3rd, 2015 6:04pm

Many thanks, that worked!
  • Marked as answer by selits19 Tuesday, March 03, 2015 8:58 PM
  • Edited by selits19 Tuesday, March 03, 2015 9:19 PM
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2015 6:04pm

Many thanks, that worked!
  • Marked as answer by selits19 Tuesday, March 03, 2015 8:58 PM
  • Edited by selits19 Tuesday, March 03, 2015 9:19 PM
March 3rd, 2015 6:04pm

Many thanks, that worked!
  • Marked as answer by selits19 Tuesday, March 03, 2015 8:58 PM
  • Edited by selits19 Tuesday, March 03, 2015 9:19 PM
  • Unmarked as answer by selits19 11 hours 17 minutes ago
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2015 6:04pm

Many thanks, that worked!
  • Marked as answer by selits19 Tuesday, March 03, 2015 8:58 PM
  • Edited by selits19 Tuesday, March 03, 2015 9:19 PM
  • Unmarked as answer by selits19 Monday, March 16, 2015 7:45 PM
March 3rd, 2015 6:04pm

Sorry I thought it worked but it turned out that the flat file schema wizard hard coded the max occurs instead of unbounded.  I did check out Eliasen's blog, unfortunately the attached project source link is no longer valid and I sent him an email but never heard anything back.  I tried to mimic what he said in the blog but with little success.  My input file does have a tag in the header and a tag in the trailer but no tag in the body section. If you have a similar project and wouldn't mind to share, I'll be very grateful. Thanks in advance!

Free Windows Admin Tool Kit Click here and download it now
March 16th, 2015 3:47pm

Sorry I thought it worked but it turned out that the flat file schema wizard hard coded the max occurs instead of unbounded.  I did check out Eliasen's blog, unfortunately the attached project source link is no longer valid and I sent him an email but never heard anything back.  I tried to mimic what he said in the blog but with little success.  My input file does have a tag in the header and a tag in the trailer but no tag in the body section. If you have a similar project and wouldn't mind to share, I'll be very grateful. Thanks in advance.



  • Edited by selits19 5 hours 33 minutes ago
March 16th, 2015 7:45pm

Sorry I thought it worked but it turned out that the flat file schema wizard hard coded the max occurs instead of unbounded.  I did check out Eliasen's blog, unfortunately the attached project source link is no longer valid and I sent him an email but never heard anything back.  I tried to mimic what he said in the blog but with little success.  My input file does have a tag in the header and a tag in the trailer but no tag in the body section. If you have a similar project and wouldn't mind to share, I'll be very grateful. Thanks in advance.



  • Edited by selits19 Wednesday, March 18, 2015 1:29 AM
Free Windows Admin Tool Kit Click here and download it now
March 16th, 2015 7:45pm

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

Other recent topics Other recent topics