|
Home > Archive > BizTalk Server Applications Integration > October 2004 > Positional Flat File Parsing
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Positional Flat File Parsing
|
|
| Sandeep Nair 2004-10-06, 5:49 pm |
| Hi,
I have the following requirement -
I have a positional text file that looks like this -
HI001AddressName - { Header }
DDate00100020007 - {Detail Record for the Header above}
I have defined a schema for the header and another schema for the detail in
Biztalk 2004.
What i need to do is this - i have to map the data from the source file to a
destination schema. The destination schema requires data from both the header
as well as the detail.
I have also defined the destination schema. I have defined 2 maps - one for
the header and one for the detail (so that i can map the respective fields to
the destination)
In my receive pipeline, i specify the document schema = Detail schema and
Header Schema = Header schema.
I also have a receive and send port. In the send port, under the 'Filters &
Maps' i am able to specify both my header and detail map. But when the
destination XML file is created, i am seeing that only data from the Detail
part of the source file is being used. The interface is completely ignoring
the data from the header.
Any idea why this could be happening?
Thanks and regards,
Sandeep.
| |
| Nabeel Prior 2004-10-08, 5:48 pm |
| Hi Sandeep,
By my understanding, using the header option in the flat file parsing
is for stripping the header from the body the file you want to
further process. You can promote properties on this header for use
later in an orchestration / filtering, but once it has been stripped
from the document it is no longer a document in its own right.
It sounds like you should rather be creating one document schema that
contains a header record (occurs once) and a detail record (occurs
many times). In your mapper you would then have the header record
and detail record(s) available in the mapping process.
I am not sure if this will satisfy your particular requirements?
Kind Regards,
Nabeel Prior
2004/10/07 00:39:04
Sandeep Nair <"Sandeep Nair"@discussions.microsoft.com> wrote in
message
<82946F0C-4250-46AF-BF27-85088D865A41@microsoft.com>
> Hi,
>
> I have the following requirement -
>
> I have a positional text file that looks like this -
>
> HI001AddressName - { Header }
> DDate00100020007 - {Detail Record for the Header above}
>
> I have defined a schema for the header and another schema for the
detail in
> Biztalk 2004.
> What i need to do is this - i have to map the data from the source
file to a
> destination schema. The destination schema requires data from both
the header
> as well as the detail.
> I have also defined the destination schema. I have defined 2 maps -
one for
> the header and one for the detail (so that i can map the respective
fields to
> the destination)
> In my receive pipeline, i specify the document schema = Detail
schema and
> Header Schema = Header schema.
> I also have a receive and send port. In the send port, under the
'Filters &
> Maps' i am able to specify both my header and detail map. But when
the
> destination XML file is created, i am seeing that only data from
the Detail
> part of the source file is being used. The interface is completely
ignoring
> the data from the header.
>
> Any idea why this could be happening?
>
> Thanks and regards,
>
> Sandeep.
| |
| Sandeep 2004-10-08, 5:48 pm |
| Hi Nabeel,
I greatly appreciate your response. I actually already stared on the second
approach u mentioned. And now the file is parsing well. Thanks so much!
Just one more on the same note - Is there a way to tell the disassembler
that the data in the tex file is related? i mean there could be one header
record having multiple corresponding detail records. When the target instance
is created, the header and detail records much be together.
The file has a format like this -
HDRN1001.................
HDRL1002.................
DTLN1001................. (Detail record for HDRN1001)
DTLN1001.................. (2nd Detail for HDRN1001)
DTLL1002..................(Detail for HDRL1002..) ...and so on....
Any ideas on this?
Thanks and Regards,
Sandeep.
"Nabeel Prior" wrote:
> Hi Sandeep,
> By my understanding, using the header option in the flat file parsing
> is for stripping the header from the body the file you want to
> further process. You can promote properties on this header for use
> later in an orchestration / filtering, but once it has been stripped
> from the document it is no longer a document in its own right.
>
> It sounds like you should rather be creating one document schema that
> contains a header record (occurs once) and a detail record (occurs
> many times). In your mapper you would then have the header record
> and detail record(s) available in the mapping process.
>
> I am not sure if this will satisfy your particular requirements?
>
> Kind Regards,
>
> Nabeel Prior
>
> 2004/10/07 00:39:04
> Sandeep Nair <"Sandeep Nair"@discussions.microsoft.com> wrote in
> message
> <82946F0C-4250-46AF-BF27-85088D865A41@microsoft.com>
>
> detail in
> file to a
> the header
> one for
> fields to
> schema and
> 'Filters &
> the
> the Detail
> ignoring
>
| |
| Tomas Restrepo \(MVP\) 2004-10-09, 2:46 am |
| Sandeep,
> I greatly appreciate your response. I actually already stared on the
second
> approach u mentioned. And now the file is parsing well. Thanks so much!
> Just one more on the same note - Is there a way to tell the disassembler
> that the data in the tex file is related? i mean there could be one header
> record having multiple corresponding detail records. When the target
instance
> is created, the header and detail records much be together.
> The file has a format like this -
> HDRN1001.................
> HDRL1002.................
> DTLN1001................. (Detail record for HDRN1001)
> DTLN1001.................. (2nd Detail for HDRN1001)
> DTLL1002..................(Detail for HDRL1002..) ...and so on....
>
> Any ideas on this?
Humm.... I imagine you'd like to have this nest the related records under
the corresponding header, right?
If so, sounds like the kind of thing that would be easier to do with a map
after parsing the original file, no?
--
Tomas Restrepo
tomasr@mvps.org
|
|
|
|
|