Best way to go about this?


 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Best way to go about this?
# 1  
Old 09-27-2012
Best way to go about this?

I am processing a very large file, which is a text csv report of a database.

I would like to parse this csv file into a bunch of XML files.

I am trying to decide the most efficient way to go about doing this.

Should I open all the XML files at the same time, and as I encounter data I write to whichever descriptor? This approach would only require iterating through the csv file once. But I would be maintaining a bunch of descriptors at the same time, is that efficient?

Should I open and close a descriptor each time I need to write a piece of information to one of the XML files? This approach would also only require iterating through the csv file once. But I would be constantly opening and closing descriptors.

Should I fill out each XML file one at a time, iterating through the whole csv file each time?

Help much appreciated.
# 2  
Old 09-27-2012
How many different files are we talking about?
# 3  
Old 09-27-2012
Transform 1 CSV file into a dozen XML files.
# 4  
Old 09-27-2012
A dozen descriptors isn't very many. I'd just keep them open.

Regards,
Alister
This User Gave Thanks to alister For This Post:
# 5  
Old 09-27-2012
OK I will do that thanks
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question