Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

Flatfile disassembler

BizTalk 2004

This group is for all content related to BizTalk Server 2004. This includes a forum, samples, videos, labs, whitepapers, and tools. Most of the content here also applies to other versions of BizTalk beyond 2004.

Flatfile disassembler

  • rated by 0 users
  • This post has 7 Replies |
  • 0 Followers
  • Hello.
    I find your video on FlatFileDiss informative. Please forgive the extremely novice attitude you will hear from me. I need to parse out a multi-level flat file into separate xml documents. In your example you have a header for the batch job, and separate documents that you return as output if I understood it correctly. How would I handle the case where there is not really a header in my files. Here's a simple representation of the FF's I deal with. 3 envelopes below, all identical for simplicity.

    ENV|abc|123
    HDR|def|456|!@#
    LIN||xyz|098|nop
    ENV|abc|123
    HDR|def|456|!@#
    LIN||xyz|098|nop
    ENV|abc|123
    HDR|def|456|!@#
    LIN||xyz|098|nop

    how would you suggest I set up my document and header schemas?

    thanks in advance
    Edit
  • Hello.

    I would set this up putting the Envelope into the file. I would create a single schema like this:
    ENV|abc|123
    HDR|def|456|!@#
    LIN||xyz|098|nop

    Then, used the native features of the Flat File Disassembler each message will be broken up and sent to the message box. So, if you message has 5 ENV you will get 5 messages.

    I would not message with a header.

    Do you think this would work for you?

    Stephen W. Thomas
    http://www.BizTalkGurus.com

  • This is what I've managed to do:

    I created one single schema that has an Envelope Node \"ENVs,\" and then have a Child Record under it that is the ENV structure itself. I leave the max and min occurences to the default (1), as my understanding is it will create a separate instance/xml file for each ENV.

    I use ffdasm at the command prompt and get separate XML files. When I deploy my solution and run it, it fails. The stream errors in the middle of one of the children on the last line of the n-th ENV.

    ex:

    LIN|xyz|0*98|nop

    * - where the stream stops.

    I found that this is tied to the child delimter of 0x0D 0x0A being at the end of the last line. So I actually took it out (b/c suppressing trailing delimiters didn't seem to make a difference). I run the orchestration again, and it runs through...BUT, one large XML instead of separate ones. AND, when I run ffdasm at the command prompt, it fails giving me a similar error where the parsing fails in the middle of a field.
    Edit
  • I re-read your response. So you don't think I should have an \"ENV's\" node, but rather JUST have the ENV under the schema node, and have the rest of my structure under that?
    [quote user=\"Stephen W. Thomas\"]Hello.

    I would set this up putting the Envelope into the file. I would create a single schema like this:
    ENV|abc|123
    HDR|def|456|!@#
    LIN||xyz|098|nop

    Then, used the native features of the Flat File Disassembler each message will be broken up and sent to the message box. So, if you message has 5 ENV you will get 5 messages.

    I would not message with a header.

    Do you think this would work for you?
    Edit
  • Yes, I do not think you need to use an Envelope in this case.

    I would first break the message up and get it into Xml. If you need to remove the Envelope later on, you can do it inside a map in the Orchestation or Send port.

    Do you think that will work for you?

    Stephen W. Thomas
    http://www.BizTalkGurus.com

  • [quote user=\"Stephen W. Thomas\"]Yes, I do not think you need to use an Envelope in this case.

    I would first break the message up and get it into Xml. If you need to remove the Envelope later on, you can do it inside a map in the Orchestation or Send port.

    Do you think that will work for you?


    OK, when I change my schema, the pipeline is still trying to use the message type \"http://blah.blah#ENVs\", rather than \"http://blah.blah#ENV\" (no s).

    How can I change that? I completely took out that node of the schema.
    Edit
  • Lets see. Try removing the schema from the collection list inside the Flat File Disassembler. Then, re-add it.

    If that doesn’t work. Delete the Flat File Disassembler and add it back into the pipeline. Make sure you are restarting the host as well.

    Let me now how it goes.

    Stephen W. Thomas
    http://www.BizTalkGurus.com

  • [quote user=\"Stephen W. Thomas\"]Lets see. Try removing the schema from the collection list inside the Flat File Disassembler. Then, re-add it.

    If that doesn’t work. Delete the Flat File Disassembler and add it back into the pipeline. Make sure you are restarting the host as well.

    Let me now how it goes.

    Hey Stephen,
    Those steps didn't help, so I just made a backup of my work, and started another project clean (since I obviously wasn't too far along :P). Works like a charm! Thanks so much for your help, such a simple solution, but then again it was a simple problem.

    Thanks!
    Tom
    Edit
  • Page 1 of 1 (8 items)