Falt File - problems with file format
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Falt File - problems with file format




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Falt File - problems with file format  
Alex


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:51 PM

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
1StreetCustomer2CityCustomer1CityCus
tomer2

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





[ Post a follow-up to this message ]



    RE: Falt File - problems with file format  
David Downing [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:51 PM

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






[ Post a follow-up to this message ]



    Re: Falt File - problems with file format  
Alex


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 05: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$fWEH
A.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.googl
e.
> com!not-for-mail 
>  ustomer2 
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> EBusiness Server Team





[ Post a follow-up to this message ]



    Re: Falt File - problems with file format  
Nick Malik


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-28-04 02:13 PM

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...[vbcol=seagreen]
> 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[/vbcol
]
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] 







[ Post a follow-up to this message ]



    Re: Falt File - problems with file format  
David Downing [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-29-04 12:29 AM

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...[vbcol=seagreen]
> 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[/vbcol
]
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] 







[ Post a follow-up to this message ]



    Re: Falt File - problems with file format  
Alex


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 12:49 PM

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@att
bi_s52>...[vbcol=seagreen]
> First thought: find the person who came up with this format and inform the
m
> 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.  O
ne
> thing I am certain of: if you don't capture the integers, you won't be abl
e
> 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!newsfeed0
0.s 
>  ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.goog
le. 
>  rights. 





[ Post a follow-up to this message ]



    Re: Falt File - problems with file format  
Alex


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 12:49 PM

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:<#7Wp8bSXEH
A.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 parse
r
> 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 th
en
> 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 migh
t
> 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!newsfeed0
0.s 
>  ul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad.net!postnews2.goog
le. 
>  rights. 





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:48 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register