473,836 Members | 1,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what would be the best choice: csv or XML

I have an application need export ane import data of projects. There are
about 10 database tables releated to one project. 3 of them each could have
up to 100K lines data.

I can export all data out into a xml file and then zip it. When I do import,
I parse this xml file and then insert into database myself.

Or I can export all tables out in csv format and then use mysql's client
command "load local file" (which is claimed very fast command).

I have keep thinking which is best choice. Will Using XML format to import
consume too much momory and what are best way(classes, API in C#) to use
xml?

Use csv file, size should be smaller, and mysql client tool is fast. But not
so portable and when I can not show a progress bar while doing import ...

Can some experts comment on this?
Thanks!
Ryan
May 24 '06 #1
5 2754
Ryan,

I would use the CSV. The only reason I would use XML is if you had a
need for heiarchical data structures, and/or needed to query the data in
some way (through XPath, XQuery).

However, since you don't need either of those things, I think that a CSV
file would be better. Also, since mysql has an import/export feature using
CSV files (SQL Server has this as well) which is fast, it would aid your
development, since you don't have to code against bringing XML into your app
then dumping it into your tables. You could just issue the command and be
done with it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ryan Liu" <ad********@onl ine.sh.cn> wrote in message
news:e6******** ******@TK2MSFTN GP05.phx.gbl...
I have an application need export ane import data of projects. There are
about 10 database tables releated to one project. 3 of them each could
have
up to 100K lines data.

I can export all data out into a xml file and then zip it. When I do
import,
I parse this xml file and then insert into database myself.

Or I can export all tables out in csv format and then use mysql's client
command "load local file" (which is claimed very fast command).

I have keep thinking which is best choice. Will Using XML format to import
consume too much momory and what are best way(classes, API in C#) to use
xml?

Use csv file, size should be smaller, and mysql client tool is fast. But
not
so portable and when I can not show a progress bar while doing import ...

Can some experts comment on this?
Thanks!
Ryan

May 24 '06 #2
Are you going to export manually, or your app do it for u?
Why not to export/import into sql file, like sequence of create/instert
statements?

In you case, if you xml data wont increase in 50 times, you are not going to
validate you Xml data and load it into DOM there are no significant
differences between Xml and CVS. You can use XmlWriter/XmlReader for this
I have an application need export ane import data of projects. There are
about 10 database tables releated to one project. 3 of them each could have
up to 100K lines data.

I can export all data out into a xml file and then zip it. When I do import,
I parse this xml file and then insert into database myself.

Or I can export all tables out in csv format and then use mysql's client
command "load local file" (which is claimed very fast command).

I have keep thinking which is best choice. Will Using XML format to import
consume too much momory and what are best way(classes, API in C#) to use
xml?

Use csv file, size should be smaller, and mysql client tool is fast. But not
so portable and when I can not show a progress bar while doing import ...


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

May 24 '06 #3
Hi,

I would go for CSV, the file generated will be smaller, much smaller
probably and the import will also be performed by mysql.

and believe me, CSV is portable . I do communicate with a couple of unix
system and all of them use a variation of CSV (only using another char
instead of , )

The progress bar problem is real, you have no control over the execution,
what you can do is spawn a hidden process from your program that execute
mysql client and have either a progress bar or a moving image (a la copying
file in explorer) and checking the status of the new process.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Ryan Liu" <ad********@onl ine.sh.cn> wrote in message
news:e6******** ******@TK2MSFTN GP05.phx.gbl...
I have an application need export ane import data of projects. There are
about 10 database tables releated to one project. 3 of them each could
have
up to 100K lines data.

I can export all data out into a xml file and then zip it. When I do
import,
I parse this xml file and then insert into database myself.

Or I can export all tables out in csv format and then use mysql's client
command "load local file" (which is claimed very fast command).

I have keep thinking which is best choice. Will Using XML format to import
consume too much momory and what are best way(classes, API in C#) to use
xml?

Use csv file, size should be smaller, and mysql client tool is fast. But
not
so portable and when I can not show a progress bar while doing import ...

Can some experts comment on this?
Thanks!
Ryan

May 24 '06 #4
Ryan Liu wrote:
I have an application need export ane import data of projects. There are
about 10 database tables releated to one project. 3 of them each could have
up to 100K lines data.

I can export all data out into a xml file and then zip it. When I do import,
I parse this xml file and then insert into database myself.

Or I can export all tables out in csv format and then use mysql's client
command "load local file" (which is claimed very fast command).


Pretty well every major database out there has some capability to import
CSV files, thus CSV is often your best choice for transferring data
between disparate databases.

Andrew Faust
May 24 '06 #5
> Use csv file, size should be smaller, and mysql client tool is fast.
But not
so portable and when I can not show a progress bar while doing import ...


Not so portable? CSV is about the most portable file format in
existance. I've retrieved data extracts from AS/400, Revelation,
Postgres, Oracle, SQL Server, Access, Fox Pro, DB/2, TopSpeed and more
in CSV format and then loaded Oracle, SQL Server, Access & DB/2 from csv
files. You won't get all those databases natively working with XML.

Andrew Faust
May 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
14895
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
86
7817
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that: http://www.clagnut.com/blog/348/ I hope that's going to be a good discussion! Michael
46
4281
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do believe MSFT should do to improve C#, however. I know that in the "Whidbey" release of VS.NET currently
41
3455
by: Mountain Bikn' Guy | last post by:
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.
24
2883
by: invitro81 | last post by:
Hello I've recently learnt python and I do love it! I congratulate all those geeks who produce this nice language; well, because I could be called a nearby newbee I've decided to improve my abilities by writing my own nice editor with python; so I've to choose among all those GUI toolkit's available there.. But I've no idea which one I should use to start with.. I've read that tkinter seems to be the de facto standart in the pyhon...
6
1679
by: ashishnh33 | last post by:
cud any one tell me what is the problem in this program #include<iostream.h> #include<conio.h> #include<stdlib.h> int binarysearch(void) int linearsearch(void) class search { private: int,beg,mid,end,,i,j,n,item;
5
348
by: sherifffruitfly | last post by:
Hi, I'm just learning cpp, and the exercise I'm working on is basically as follows: 1) Create a struct type with 4 members (char, char, char, int). 2) Create an array of, say 3 instances of the struct, and populate them with data. 3) cin 1, 2, 3, or 4 from the user 4) If the user selected, say, 2, display the contents of the 2nd data
3
2050
by: alacrite | last post by:
You have higher level, lower level, and those languages in between. Generally speaking higher level languages are considered more productive at the cost of a slower runtime. While lower level languages are less productive but usually produce a faster runtime. On the low end when would you choose C++ over C. It seems that many OS's, device drivers, and DB's are written in C. And when would you use C++ over higher level languages. Where does...
8
4071
by: pamela fluente | last post by:
I need an opinion. I have to add NEW pages to an existing site. The site has - also - some ASPX pages. These pages, I have seen, have the following doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > These pages are very recent and generated by VS 2005 (most modern tool
0
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10854
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10558
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10600
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4459
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.