473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 7016
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ben | last post by:
Hi all - I am having a bit of trouble and thought maybe someone in this group could shed some light. Here's the skinny... I am creating an automated process to import a bunch of text files...
1
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am...
1
by: The Bear | last post by:
I have populated a dataset with a tab delimited text file. When the changes are made in the dataset, I then want to write those changes from the dataset to a tab delimited text file. How do I write...
0
by: TJS | last post by:
attempting to read a delimited text file into a dataset using oledb text file connection getting this error message when trying to open connection...
3
by: Joe Fisherman | last post by:
I have used regex to parse a huge text file, and grab a tab delimited portion of it. I often use comma delimited text files, and use Jet Oledb4. I read that I would need an ini if the file wasn't...
9
by: Bernie Yaeger | last post by:
Is there a way to convert or copy a .xml file to a comma delimited text file using vb .net? Thanks for any help. Bernie Yaeger
0
by: Masa Ito | last post by:
I have pipe delimited (and comma/tab) files that I read with JET using a schema file. Occasionally a field has multiple quotes (") inside a single field - which chokes the line (the rest of the...
1
by: Fordraiders | last post by:
vb.net 2003 Office 2003 What I have: C:\TestData\Input.txt Text File Pipe Delimited : 4 columns Of data example: 00001|NO BRAND NAME ASSIGNED|6DU27|M3-.5 X 6 FLAT HD SOCKET CAP SCREW,...
6
by: =?Utf-8?B?UmljaA==?= | last post by:
'--this code works but only reads text into one column when contains multiple cols Dim ds1x As New DataSet Dim ConStr As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.