473,378 Members | 1,457 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,378 software developers and data experts.

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 2710
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.com

"Ryan Liu" <ad********@online.sh.cn> wrote in message
news:e6**************@TK2MSFTNGP05.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********@online.sh.cn> wrote in message
news:e6**************@TK2MSFTNGP05.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
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...
86
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:...
46
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...
41
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
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...
6
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:...
5
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...
3
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...
8
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.