LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 10-24-2014, 12:16 AM   #1
AkhilSJSU
LQ Newbie
 
Registered: Oct 2014
Posts: 3

Rep: Reputation: Disabled
Converting 30 GB XML File to CSV file


I need to convert 30GB of XML file to CSV. I wrote a Java program to convert XML file to CSV file but I am getting Java out of memory error as it is exceeding Heap memory.Please provide some software that convert large XML file to CSV.Any suggestions would be appreciated.
 
Old 10-24-2014, 02:00 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
If you have some little knowlegde in Perl you can write a SAX parser that will not need much RAM to parse the XML file. Or you can look for it on the web.
 
1 members found this post helpful.
Old 10-24-2014, 02:21 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
From the error description I bet you just read in more and more data till the memory is exhausted. Maybe check on your program and have lower numbers of the chunks of data you read and write.
 
Old 10-24-2014, 04:17 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
In general there are 2 basic approaches. You can parse XML by reading in the whole document in an object or you can parse it sequentially. Java provides this 2nd option, too.

http://www.javabeat.net/parsing-xml-...nts-using-sax/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me convert this xml file to csv xmrkite Linux - Software 2 06-21-2014 09:48 PM
Converting .txt file to a csv file kamesp Linux - Software 9 04-20-2013 07:45 AM
[SOLVED] Parsing text file with passwords and converting to CSV list Jumpingmushroom Programming 10 04-15-2013 03:11 AM
[SOLVED] awk or sed to use CSV as input and XML as template and output to a single file bridrod Linux - Newbie 6 03-13-2012 07:00 PM
looking for software to convert multiple csv files to a single xml file Rocket-boy Linux - Software 6 10-28-2009 10:03 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 07:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration