Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Positional Flat File with Header & Footer to XML
- This topic has 1 reply, 1 voice, and was last updated 9 years, 6 months ago by
community-content.
-
AuthorPosts
-
-
February 26, 2007 at 11:33 AM #17796
Hi,
I have a problem with a flat file that I need to disassemble into separate XML files. The problem is I need to do this without tagging each record as I have no control over the format fo the incoming data as its from a legacy system.
A sample of the file in simplified format is as follows:
ID12052007
Mr Jo Bloggs M
Mrs Jane Bloggs F
Mr Sam Smith M
3The header contains a Tag + the data, the body a series of fields followed by CR/LF and the footer a record count.
I have used a pipeline with a flat file disassembler and have generated three schemas, one each for Header, Body and Footer. I have set Max occurs on body to 1.
If I use a tag before each row of data everything works happily, and I have tried delimted records with a tag and that works too. What I need however is to do this without a tag – any ideas would be very welcome. A lot of samples come close to this but nothing does it exactly.
To be honest I don't need the Header and Footer for processing, just the Body so a solution that looses the extra data is fine.
Thanks for any help in advance.
-
February 27, 2007 at 4:43 AM #17804
[quote user="Hermit"]
Hi,
I have a problem with a flat file that I need to disassemble into separate XML files. The problem is I need to do this without tagging each record as I have no control over the format fo the incoming data as its from a legacy system.
A sample of the file in simplified format is as follows:
ID12052007
Mr Jo Bloggs M
Mrs Jane Bloggs F
Mr Sam Smith M
3The header contains a Tag + the data, the body a series of fields followed by CR/LF and the footer a record count.
I have used a pipeline with a flat file disassembler and have generated three schemas, one each for Header, Body and Footer. I have set Max occurs on body to 1.
If I use a tag before each row of data everything works happily, and I have tried delimted records with a tag and that works too. What I need however is to do this without a tag – any ideas would be very welcome. A lot of samples come close to this but nothing does it exactly.
To be honest I don't need the Header and Footer for processing, just the Body so a solution that looses the extra data is fine.
Thanks for any help in advance.
[/quote]
Herman,
The key to your solution is that you said "I don't need the Header and Footer for processing, just the Body so a solution that looses the extra data is fine."
To me this means that if you parse the file and map from the body you are fine.
What you want to define is one schema containing:
a header record with a count of 1
a detail record, count 1 to *
a trailer record with a count of 1Then just map from the detail record.
You don't need tags, as there aren't any in the data and the structure is enough to parse the file. Also, it seems like you don't to parse to three XML files.
-wa
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.