Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Wed, 1 Jul 2009 16:04:50 -0500,    group: microsoft.public.dotnet.xml        back       


Need help converting a multi entity flat file into XML   
I have a legacy system that outputs a billing file where each data element 
has a specific length. The billing file has multiple information

1. Customer billing information
2. Customer shipping information
3. Order information (#, date, totals etc...)
4. Order line items (item#, qty, unit price, line total)

Up until item 3 - it is fixed length. Since an order can have one or more 
line items the overall length of the record will vary. The order line itself 
will be fixed size that may repeat itself

I need help in figuring out how to transform this into XML. I have come 
across examples of flat file to xml conversions where the entire record is 
fixed length.

Any help or pointers to a solution is appreciated. Please note I do not have 
BizTalk or similar products

Thanks
date: Wed, 1 Jul 2009 16:04:50 -0500   author:   Shikari Shambu

Re: Need help converting a multi entity flat file into XML   
Shikari Shambu wrote:
> I have a legacy system that outputs a billing file where each data 
> element has a specific length. The billing file has multiple information
> 
> 1. Customer billing information
> 2. Customer shipping information
> 3. Order information (#, date, totals etc...)
> 4. Order line items (item#, qty, unit price, line total)
> 
> Up until item 3 - it is fixed length. Since an order can have one or 
> more line items the overall length of the record will vary. The order 
> line itself will be fixed size that may repeat itself
> 
> I need help in figuring out how to transform this into XML. I have come 
> across examples of flat file to xml conversions where the entire record 
> is fixed length.

With the .NET framework using regular expression matching might help to 
identify items in that flat file. To create XML you can use XmlWriter or 
  XmlDocument or (in .NET 3.5) LINQ to XML.


-- 

	Martin Honnen --- MVP XML
	http://msmvps.com/blogs/martin_honnen/
date: Thu, 02 Jul 2009 13:43:42 +0200   author:   Martin Honnen

Re: Need help converting a multi entity flat file into XML   
Martin,
    Thanks for the input. I guess I forgot to mention that the attributes 
are position based I.e. first 20 chars= customer first name 21st= middle 
initial 22-42= last name etc... I am not sure if RegEx can help here. If you 
have examples I would look to take a look.

Thanks

"Martin Honnen"  wrote in message 
news:O3d7cpw#JHA.1336@TK2MSFTNGP05.phx.gbl...
> Shikari Shambu wrote:
>> I have a legacy system that outputs a billing file where each data 
>> element has a specific length. The billing file has multiple information
>>
>> 1. Customer billing information
>> 2. Customer shipping information
>> 3. Order information (#, date, totals etc...)
>> 4. Order line items (item#, qty, unit price, line total)
>>
>> Up until item 3 - it is fixed length. Since an order can have one or more 
>> line items the overall length of the record will vary. The order line 
>> itself will be fixed size that may repeat itself
>>
>> I need help in figuring out how to transform this into XML. I have come 
>> across examples of flat file to xml conversions where the entire record 
>> is fixed length.
>
> With the .NET framework using regular expression matching might help to 
> identify items in that flat file. To create XML you can use XmlWriter or 
> XmlDocument or (in .NET 3.5) LINQ to XML.
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://msmvps.com/blogs/martin_honnen/
date: Thu, 2 Jul 2009 08:53:41 -0500   author:   Shikari Shambu

Re: Need help converting a multi entity flat file into XML   
Shikari Shambu wrote:

>    Thanks for the input. I guess I forgot to mention that the attributes 
> are position based I.e. first 20 chars= customer first name 21st= middle 
> initial 22-42= last name etc... I am not sure if RegEx can help here. If 
> you have examples I would look to take a look.

   Regex pattern = @"^(?<fname>.{20})(?<mname>.)(?<lname>.{20})$";
is a regular expression capturing the first twenty characters in a group 
named fname, then one character in a group named mname, then twenty 
characters in a group named lname. So that way you can easily extract 
the portions of the input string.
See http://msdn.microsoft.com/en-us/library/30wbz966.aspx or your local 
MSDN library installation on how to use the .NET regular expression classes.


-- 

	Martin Honnen --- MVP XML
	http://msmvps.com/blogs/martin_honnen/
date: Thu, 02 Jul 2009 16:10:18 +0200   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us