how to deal with multiple-line-trailer in flatfile

Home Page Forums BizTalk 2004 – BizTalk 2010 how to deal with multiple-line-trailer in flatfile

Viewing 1 reply thread
  • Author
    Posts
    • #14051

      A sample CSV:

      Store,Door,Start Date,Time,Sun,Mon,Tue,Wed,Thr,Fri,Sat
      BR01,1,20060612,0,0,0,0,0,0,0,0
      BR01,1,20060612,100,0,0,0,0,0,0,0
      BR01,2,20060612,200,0,0,0,0,0,0,0
      BR01,2,20060612,300,0,0,0,0,0,0,0
      BR01,Combined,20060612,0,0,0,1,0,0,0,0
      BR01,Combined,20060612,100,0,0,2,0,0,0,0
      Totals,Door 1,20060612,0,3,0,11,0,5,0,19
      Totals,Door 2,20060612,0,0,0,0,0,0,0,0
      Totals,Combined,20060612,0,144,210,12,0,5,0,371

      The trailer is the Totals part, but includes multiple lines. I need to store the data in body part in a table, and put the trailer part in another table. How to debatch the trailer?

      Thanks…

    • #14052

      I’d create an Envelope Schema like:
      <root>
      <Doc>
      <Header>
      <Details> (1 to many for 1 record out and 1 to 1 for single records out)
      <Trailer> (record CR/LF delimited)
      <Totals>

      Set the body xpath at <root> and define three schemas for header, details, and trailer. Then, you should get three separate files out.

      To get into SQL you could simple use the SQL Adapter in a messaging solution or a simple Orchestration.

      Make sense?

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.