Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When I Have > 1 Table Format To Import Should I Import CSV, XML or Multiple CSV's?

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I have the need to write a simple application to read data from an external source and pump it into an AS400 database.
I've done this before successfully but I've always used Excel and CSV as input formats.

Excel is a pain because users always screw up the data format somewhere.
CSV works quite well but I have two record formats ( header and multiple detail lines ) that I need to import this time.
I want to possibly use the program to import from other sources ion the future.

So I figure these are my options:-

1) CSV With Redundant Header Data
I could have one row per detail line and have redundant header data appear on each row.

2) Header.CSV and Detail.CSV
Two CSV files that would have to be read in tandom which makes coding more difficult and more likely the source will be wrong.

3) Two Record Format CSV
Have a row with 'Header' as the first record field before multiple rows with 'Detail'as the first field.
Both types have a different record format.

4) XML
The proper way of doing 3) but a bit more difficult for all possible sources to produce.

Curious to know what is the best option - if there really is one.
I'm tending to think 1) or 4) would be the best options.
Opinions anybody?




Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top