Best way to go about this? | Unix Linux Forums | Emergency UNIX and Linux Support

  Go Back    


Emergency UNIX and Linux Support Please post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply.

Best way to go about this?

Emergency UNIX and Linux Support


Tags
xml

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-27-2012
stevensw stevensw is offline
Registered User
 
Join Date: Apr 2011
Last Activity: 7 February 2013, 1:28 PM EST
Posts: 69
Thanks: 19
Thanked 0 Times in 0 Posts
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.
Sponsored Links
    #2  
Old 09-27-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 25 July 2014, 4:11 PM EDT
Location: Saskatchewan
Posts: 18,978
Thanks: 748
Thanked 3,146 Times in 2,951 Posts
How many different files are we talking about?
Sponsored Links
    #3  
Old 09-27-2012
stevensw stevensw is offline
Registered User
 
Join Date: Apr 2011
Last Activity: 7 February 2013, 1:28 PM EST
Posts: 69
Thanks: 19
Thanked 0 Times in 0 Posts
Transform 1 CSV file into a dozen XML files.
    #4  
Old 09-27-2012
alister alister is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 11 June 2014, 8:40 PM EDT
Posts: 3,231
Thanks: 179
Thanked 973 Times in 789 Posts
A dozen descriptors isn't very many. I'd just keep them open.

Regards,
Alister
The Following User Says Thank You to alister For This Useful Post:
stevensw (09-27-2012)
Sponsored Links
    #5  
Old 09-27-2012
stevensw stevensw is offline
Registered User
 
Join Date: Apr 2011
Last Activity: 7 February 2013, 1:28 PM EST
Posts: 69
Thanks: 19
Thanked 0 Times in 0 Posts
OK I will do that thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -4. The time now is 07:10 AM.