469,351 Members | 1,769 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,351 developers. It's quick & easy.

Converting Delimited Text File into XML

Hello

I want to convert a huge delimited text file (of appr 85MB) directly into XML. I dont want to loop through the text file and write as xml, as it is very large file and taking much time. Can any one help me, how to convert

Thanks in advance for all your help

Best Rgds
Padmaja.
Nov 12 '05 #1
10 6702
Given that you have access to a db that can return result sets in XML, you
might want to try to import the csv to a temporary table and then query the
table whos output is XML.

"Padmaja" <an*******@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
Hello,

I want to convert a huge delimited text file (of appr 85MB) directly into XML. I dont want to loop through the text file and write as xml, as it is
very large file and taking much time. Can any one help me, how to convert ?
Thanks in advance for all your help.

Best Rgds,
Padmaja.

Nov 12 '05 #2
Thanks solex, can you tell me how to convert csv to a temp. table

Rgds
Padmaj

----- solex wrote: ----

Given that you have access to a db that can return result sets in XML, yo
might want to try to import the csv to a temporary table and then query th
table whos output is XML

"Padmaja" <an*******@discussions.microsoft.com> wrote in messag
news:F2**********************************@microsof t.com..
Hello
I want to convert a huge delimited text file (of appr 85MB) directly int XML. I dont want to loop through the text file and write as xml, as it i
very large file and taking much time. Can any one help me, how to convert Thanks in advance for all your help
Best Rgds

Padmaja


Nov 12 '05 #3
Padmaja,

Unfortunately this all depends upon your database. For instance SQL server
supports XML but MS Access does not, if you have SQL server you might want
to do some research on XML and importing or check some of the SQL Server
news groups. In addition I found this resource via google which may help:

http://weblogs.asp.net/kaevans/archi...4/17/5780.aspx

For others resources check:
http://www.google.com/search?q=CSV+t...utf-8&oe=utf-8

Regards,
Dan

"Padmaja" <an*******@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
Thanks solex, can you tell me how to convert csv to a temp. table?

Rgds,
Padmaja

----- solex wrote: -----

Given that you have access to a db that can return result sets in XML, you might want to try to import the csv to a temporary table and then query the table whos output is XML.

"Padmaja" <an*******@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
> Hello,
>> I want to convert a huge delimited text file (of appr 85MB) directly into
XML. I dont want to loop through the text file and write as xml, as it is very large file and taking much time. Can any one help me, how to

convert ? >> Thanks in advance for all your help.
>> Best Rgds,

> Padmaja.


Nov 12 '05 #4
Padmaja wrote:
I want to convert a huge delimited text file (of appr 85MB) directly into XML. I dont want to loop through the text file and write as xml, as it is very large file and taking much time. Can any one help me, how to convert ?


Just use XmlCsvReader. See
http://msdn.microsoft.com/XML/XMLCod...lcsvreader.asp

--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #5

Thanks alot, Oleg Tkachenko. I have a question for you...how fast is this i.e. Any idea of how much time will it take for an 85MB Csv file to convert into Xml file

Best Rgds
Padmaj

----- Oleg Tkachenko [MVP] wrote: ----

Padmaja wrote
I want to convert a huge delimited text file (of appr 85MB) directly into XML. I dont want to loop through the text file and write as xml, as it is very large file and taking much time. Can any one help me, how to convert


Just use XmlCsvReader. See
http://msdn.microsoft.com/XML/XMLCod...mlcsvreader.as

--
Oleg Tkachenko [XML MVP, XmlInsider
http://blog.tkachenko.co

Nov 12 '05 #6
Is this XmlCsvReader class present in system.xml of VS.Net 2003?

Thanks
Padmaja

----- Oleg Tkachenko [MVP] wrote: ----

Padmaja wrote
I want to convert a huge delimited text file (of appr 85MB) directly into XML. I dont want to loop through the text file and write as xml, as it is very large file and taking much time. Can any one help me, how to convert


Just use XmlCsvReader. See
http://msdn.microsoft.com/XML/XMLCod...mlcsvreader.as

--
Oleg Tkachenko [XML MVP, XmlInsider
http://blog.tkachenko.co

Nov 12 '05 #7
Padmaja wrote:
Thanks alot, Oleg Tkachenko. I have a question for you...how fast is this i.e. Any idea of how much time will it take for an 85MB Csv file to convert into Xml file?


Using XmlCsvReader - not much I think. XmlCsvReader is XmlReader, so
it's non-caching, forward-only aka fast.

--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #8
Padmaja wrote:
Is this XmlCsvReader class present in system.xml of VS.Net 2003?


Nope.
You need to download XmlCsvReader and rebuild it as dll (it's exe by
default) to make use of it. See detailed description at
http://www.tkachenko.com/blog/archives/000086.html

--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #9
Thanks Oleg, I got that done successfully

----- Oleg Tkachenko [MVP] wrote: ----

Padmaja wrote
Is this XmlCsvReader class present in system.xml of VS.Net 2003?


Nope
You need to download XmlCsvReader and rebuild it as dll (it's exe by
default) to make use of it. See detailed description at
http://www.tkachenko.com/blog/archives/000086.htm

--
Oleg Tkachenko [XML MVP, XmlInsider
http://blog.tkachenko.co

Nov 12 '05 #10
Padmaja wrote:
I have some questions regarding xmlcsvreader class :-
1. How to add attributes to the elements? Any properties of xmlcsvreader to use? If so, what are they?
2. How to add namespaceUri("http://www.w3.org/2001/XMLSchema", "http://www.w3.org/2001/XMLSchema-instance", e.t.c. ) & prefix(xsd,xsi...etc)
3. How to allow null values?


I don't think that can be done with xmlcsvreader (unless you extend it).
xmlcsvreader just reads csv as XML. If you want to modify this XML, use
some kind of XML processing. XSLT is usually the simplest solution, but
if your XML is a big one, more advanced scenarios with customized
XmlReader are available.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by The Bear | last post: by
3 posts views Thread by Joe Fisherman | last post: by
9 posts views Thread by Bernie Yaeger | last post: by
1 post views Thread by Fordraiders | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.