BizTalk Server General - Falt File - problems with file format

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > June 2004 > Falt File - problems with file format





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 Falt File - problems with file format
Alex

2004-06-26, 10:51 am

Hi !

I have to map a posional flat file which contains customer data. This
includes the name, street, city and so on. The file has the following
format:

NameCustomer1NameCustomer2StreetCustomer
1StreetCustomer2CityCustomer1CityCustome
r2

Note that in this example I have only to customers, which is currently
the maximum. But in the future the numbers of customers could be
higher.
I have created tow schemes which I can use to validate the input data
and create XML files. The first outputs:

<CustomerData>
<NameCustomer1>Name1</NameCustomer1>
<NameCustomer2>Name2</NameCustomer2>
<StreetCustomer1>Street1</StreetCustomer1>
<StreetCustomer2>Street2</StreetCustomer2>
...
</CustomerData>

and the second scheme:

<CustomerData>
<NameCustomer>Name1</NameCustomer>
<NameCustomer>Name2</NameCustomer>
<StreetCustomer>Street1</StreetCustomer>
<StreetCustomer>Street2</StreetCustomer>
...
</CustomerData>

For better data handling I want to map it to a XML file which contains
a record element for each customer.

<Cutomer>
<Name>Name1</Name>
<Street>Street1</Street>
<City>City1</City>
</Customer>
<Cutomer>
<Name>Name2</Name>
<Street>Street2</Street>
<City>City2</City>
</Customer>

How do I have to map the schemes to get such a output and which scheme
is the better one? (I think scheme two because of the growing number
of customers)

Thank you !
Alex

PS: BizTalk 2004
David Downing [MSFT]

2004-06-26, 10:51 am

Alex,

Do you have an actual flat file instance that you can cut/past into a post
for us to take a look at? If possible also attach your schemas and map.

Thank you,
Dave
--------------------[vbcol=seagreen]
13:33:24 GMT)[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.google.
com!not-for-mail[vbcol=seagreen]
ustomer2[vbcol=seagreen]

This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team

Alex

2004-06-26, 12:04 pm

Hi Dave,

thank you for your answer. I've included a sample flat file instance.
The size of the file is 483 Bytes. The first 222 bytes (until
PhoneNumber) are easy to map and that's why not very interesting.
Complicated are the information from CustomerName1 til PhoneCustomer2.
These bytes contain the whole information about the customers. In this
case we have two of them. For the first customer CustomerName1,
AdressCustomer1 and PhoneCustomer1 are important. For the second
CustomerName2, AdressCustomer2 and PhoneCustomer2.
My goal is that I want to map these fields to a XML record element
with the corresponding elements fields.
<Cutomer>
<Name>CustomerName</Name>
<Adress>AdressCustomer</Adress>
<City>PhoneCustomer</Phone>
</Customer>

I'm sorry that I'm only allowed to give you a sample flat file. But I
think you see my problem. There wouldn't be any problem if after the
name of customer1 his adress and phone number would follow and then
the information of customer2.

Many thanks for any help !
Alex


PS: I writing you this via Google. So I think I'm not able to attach
the scheme. But if you need this I can prepare (also only) an example.

----
The sample flat file:
N987654321098765FirstNameOfTheCompany SecondNameOfTheCompany
XXXXXXXXStatePostalCity
StreetAndNumber FaxNumber
PhoneNumber CustomerName1 CustomerName2
AdressCustomer1 AdressCustomer2 PhoneCustomer1 PhoneCustomer2
Comment1
Comment2
..
----

ddowning@online.microsoft.com ("David Downing [MSFT]") wrote in message news:<D5c1n$fWEHA.2764@cpmsftngxa10.phx.gbl>...
> Alex,
>
> Do you have an actual flat file instance that you can cut/past into a post
> for us to take a look at? If possible also attach your schemas and map.
>
> Thank you,
> Dave
> --------------------
> 13:33:24 GMT)
> cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
> ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.google.
> com!not-for-mail
> ustomer2
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> EBusiness Server Team

Nick Malik

2004-06-28, 9:13 am

First thought: find the person who came up with this format and inform them
about how much work you are having to do to get around their mistakes.
Second thought: Your second format is not bad, but you have to keep ids of
the records with the record data.
<CustomerData>
<NameCustomer id="1">Name1</NameCustomer>
<NameCustomer id="2">Name2</NameCustomer>
<StreetCustomer id="1">Street1</StreetCustomer>
<StreetCustomer id="2">Street2</StreetCustomer>
...
</CustomerData>

You should be able to map this appropriately, although I'm not certain. One
thing I am certain of: if you don't capture the integers, you won't be able
to match up the values, no matter what application you use.

Good Luck,
--- Nick

"Alex" <alex_doehling@web.de> wrote in message
news:6b375d96.0406260805.e792dd4@posting.google.com...
> Hi Dave,
>
> thank you for your answer. I've included a sample flat file instance.
> The size of the file is 483 Bytes. The first 222 bytes (until
> PhoneNumber) are easy to map and that's why not very interesting.
> Complicated are the information from CustomerName1 til PhoneCustomer2.
> These bytes contain the whole information about the customers. In this
> case we have two of them. For the first customer CustomerName1,
> AdressCustomer1 and PhoneCustomer1 are important. For the second
> CustomerName2, AdressCustomer2 and PhoneCustomer2.
> My goal is that I want to map these fields to a XML record element
> with the corresponding elements fields.
> <Cutomer>
> <Name>CustomerName</Name>
> <Adress>AdressCustomer</Adress>
> <City>PhoneCustomer</Phone>
> </Customer>
>
> I'm sorry that I'm only allowed to give you a sample flat file. But I
> think you see my problem. There wouldn't be any problem if after the
> name of customer1 his adress and phone number would follow and then
> the information of customer2.
>
> Many thanks for any help !
> Alex
>
>
> PS: I writing you this via Google. So I think I'm not able to attach
> the scheme. But if you need this I can prepare (also only) an example.
>
> ----
> The sample flat file:
> N987654321098765FirstNameOfTheCompany SecondNameOfTheCompany
> XXXXXXXXStatePostalCity
> StreetAndNumber FaxNumber
> PhoneNumber CustomerName1 CustomerName2
> AdressCustomer1 AdressCustomer2 PhoneCustomer1 PhoneCustomer2
> Comment1
> Comment2
> .
> ----
>
> ddowning@online.microsoft.com ("David Downing [MSFT]") wrote in message

news:<D5c1n$fWEHA.2764@cpmsftngxa10.phx.gbl>...[vbcol=seagreen]
post[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s[vbcol=seagreen]
ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.google.[vbcol=seagreen]
rights.[vbcol=seagreen]


David Downing [MSFT]

2004-06-28, 7:29 pm

Alex,

Looking at your flat file structure, I don't see anything in the instance
data that can be used to make the data deterministic. How would the parser
know how many customer names, address... exist in the data? Typically in a
positional flat file you'll see record tags at the beginning of the data
that can be used to identify what type of a record is being parsed, and then
the individual fields are simply parsed by position within the record. In
your case, this structure doesn't exist, and there are no identifying tags
within the data to identify the data being parsed. Even though there might
be information in the first header record that specifies information about
the structure and number of entries that follow, the flat file parser
doesn't allow you to correlate the data this way. The flat file parser is
entirely grammar driven rather than context driven.

I believe that you will need to implement a custom pipeline component that
will do your flat file parsing and XML generation.

--
Dave

This posting is provided "AS IS" with no warranties, and confers no rights.

"Alex" <alex_doehling@web.de> wrote in message
news:6b375d96.0406260805.e792dd4@posting.google.com...
> Hi Dave,
>
> thank you for your answer. I've included a sample flat file instance.
> The size of the file is 483 Bytes. The first 222 bytes (until
> PhoneNumber) are easy to map and that's why not very interesting.
> Complicated are the information from CustomerName1 til PhoneCustomer2.
> These bytes contain the whole information about the customers. In this
> case we have two of them. For the first customer CustomerName1,
> AdressCustomer1 and PhoneCustomer1 are important. For the second
> CustomerName2, AdressCustomer2 and PhoneCustomer2.
> My goal is that I want to map these fields to a XML record element
> with the corresponding elements fields.
> <Cutomer>
> <Name>CustomerName</Name>
> <Adress>AdressCustomer</Adress>
> <City>PhoneCustomer</Phone>
> </Customer>
>
> I'm sorry that I'm only allowed to give you a sample flat file. But I
> think you see my problem. There wouldn't be any problem if after the
> name of customer1 his adress and phone number would follow and then
> the information of customer2.
>
> Many thanks for any help !
> Alex
>
>
> PS: I writing you this via Google. So I think I'm not able to attach
> the scheme. But if you need this I can prepare (also only) an example.
>
> ----
> The sample flat file:
> N987654321098765FirstNameOfTheCompany SecondNameOfTheCompany
> XXXXXXXXStatePostalCity
> StreetAndNumber FaxNumber
> PhoneNumber CustomerName1 CustomerName2
> AdressCustomer1 AdressCustomer2 PhoneCustomer1 PhoneCustomer2
> Comment1
> Comment2
> .
> ----
>
> ddowning@online.microsoft.com ("David Downing [MSFT]") wrote in message

news:<D5c1n$fWEHA.2764@cpmsftngxa10.phx.gbl>...[vbcol=seagreen]
post[vbcol=seagreen]
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s[vbcol=seagreen]
ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.google.[vbcol=seagreen]
rights.[vbcol=seagreen]


Alex

2004-06-30, 7:49 am

Hi Nick,

thank you for your posting. I have to agree with your first thought.
But I think thats not possible, also I would love to do so. ;-)
To your second thought: I'm not certain about the attribute "id". How
can I insert it and count it accordingly to the number of customers. I
like to give it a try and perhaps I could use a loop which creates two
record elements for me.

Thank you!
Alex

"Nick Malik" <nickmalik@hotmail.nospam.com> wrote in message news:<lnWDc.106303$2i5.3418@attbi_s52>...[vbcol=seagreen]
> First thought: find the person who came up with this format and inform them
> about how much work you are having to do to get around their mistakes.
> Second thought: Your second format is not bad, but you have to keep ids of
> the records with the record data.
> <CustomerData>
> <NameCustomer id="1">Name1</NameCustomer>
> <NameCustomer id="2">Name2</NameCustomer>
> <StreetCustomer id="1">Street1</StreetCustomer>
> <StreetCustomer id="2">Street2</StreetCustomer>
> ...
> </CustomerData>
>
> You should be able to map this appropriately, although I'm not certain. One
> thing I am certain of: if you don't capture the integers, you won't be able
> to match up the values, no matter what application you use.
>
> Good Luck,
> --- Nick
>
> "Alex" <alex_doehling@web.de> wrote in message
> news:6b375d96.0406260805.e792dd4@posting.google.com...
> news:<D5c1n$fWEHA.2764@cpmsftngxa10.phx.gbl>...
> post
> 13:33:24 GMT)
> cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
> ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.google.
> rights.
Alex

2004-06-30, 7:49 am

Hello David,

also many thanks to you for your answer. You're wondering how the
parser should know how many customers are in the flat file. To
clarify it, let me explain the situation:
My company has some clients. These clients are other firms, that use
these flat files to transport data between two applications. The
customer data IN the flat file are constant for each of our clients.
So we would create a scheme for each client with a constant number of
repeating customer data. We could then say: Client XYZ has two
customers, so he need CustomerName1, CustomerName2, AdressCustomer1
and so on. Another client could say he needs three customers. That
would mean we create a flat file scheme with CustomerName1,
CustomerName2, CustomerName3 and so on. These different schemes should
be mapped to only ONE universal scheme. That can hold as many customer
data as needed.

So that's the situation. I'm new to BizTalk 2004 and maybe we choose a
wrong approach. So please correct me when we're wrong.

I allready took a look into the developing of a custom pipeline
component. I studied the example, but I want to avoid it. Because the
documentation is not very comprehensive and I don't know how to test
and debug it. I suppose I have to run it inside a BizTalk project
which means that the error messages would only appear in the event
log. But these messages are not very informative. But if you have some
good information, links and so on please post them! I will give it a
deeper look.

Thank you !
Alex


"David Downing [MSFT]" <ddowning@online.microsoft.com> wrote in message news:<#7Wp8bSXEHA.2364@TK2MSFTNGP12.phx.gbl>...[vbcol=seagreen]
> Alex,
>
> Looking at your flat file structure, I don't see anything in the instance
> data that can be used to make the data deterministic. How would the parser
> know how many customer names, address... exist in the data? Typically in a
> positional flat file you'll see record tags at the beginning of the data
> that can be used to identify what type of a record is being parsed, and then
> the individual fields are simply parsed by position within the record. In
> your case, this structure doesn't exist, and there are no identifying tags
> within the data to identify the data being parsed. Even though there might
> be information in the first header record that specifies information about
> the structure and number of entries that follow, the flat file parser
> doesn't allow you to correlate the data this way. The flat file parser is
> entirely grammar driven rather than context driven.
>
> I believe that you will need to implement a custom pipeline component that
> will do your flat file parsing and XML generation.
>
> --
> Dave
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Alex" <alex_doehling@web.de> wrote in message
> news:6b375d96.0406260805.e792dd4@posting.google.com...
> news:<D5c1n$fWEHA.2764@cpmsftngxa10.phx.gbl>...
> post
> 13:33:24 GMT)
> cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
> ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.google.
> rights.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com