Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Absolute Beginner Talk
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Absolute Beginner Talk
The perfect starting place to find out more about computers, Linux and Ubuntu.

 
Thread Tools Display Modes
Old March 16th, 2008   #1
atorch
Just Give Me the Beans!
 
Join Date: Apr 2006
Location: Paris & California
Beans: 76
Ubuntu 9.04 Jaunty Jackalope
How do I open a 2.5 gig .xml file?

Hi,

This is going to sound a little silly, but... I have an .xml file I want to open, and I can't. It's very big (2.5 gigs), and I imagine that's part of the problem.

Firefox wants to open it by default, but it only takes me to a blank page, exactly the same as about:blank.

Text Editor tells it to me like it is: it cannot open the file because it is "too big."

OpenOffice Database just eats up tons of RAM when it tries to open the file...

I tried to open it with Notepad (through Wine), but it didn't do anything at all. Didn't eat up any memory, didn't open the file...



What can I do? I need to either i) open this file or ii) convert it into something that I can open.
atorch is offline   Reply With Quote
Old March 16th, 2008   #2
Oldsoldier2003
7.62 Full Metal Ubuntu
 
Oldsoldier2003's Avatar
 
Join Date: Jan 2008
Location: /dev/null
Beans: 2,793
Ubuntu 8.04 Hardy Heron
Re: How do I open a 2.5 gig .xml file?

Quote:
Originally Posted by atorch View Post
Hi,

This is going to sound a little silly, but... I have an .xml file I want to open, and I can't. It's very big (2.5 gigs), and I imagine that's part of the problem.

Firefox wants to open it by default, but it only takes me to a blank page, exactly the same as about:blank.

Text Editor tells it to me like it is: it cannot open the file because it is "too big."

OpenOffice Database just eats up tons of RAM when it tries to open the file...

I tried to open it with Notepad (through Wine), but it didn't do anything at all. Didn't eat up any memory, didn't open the file...



What can I do? I need to either i) open this file or ii) convert it into something that I can open.
Depending on what you want to do with it... if its a repetitive edit you could just use SED and make replacements without ever "opening the file". If its something you have to be able to read you might be better off splitting the file into usable chunks.
Oldsoldier2003 is offline   Reply With Quote
Old March 16th, 2008   #3
atorch
Just Give Me the Beans!
 
Join Date: Apr 2006
Location: Paris & California
Beans: 76
Ubuntu 9.04 Jaunty Jackalope
Re: How do I open a 2.5 gig .xml file?

Quote:
Originally Posted by Oldsoldier2003 View Post
If its something you have to be able to read you might be better off splitting the file into usable chunks.
Yes, I have to be able to read it. How do I go about splitting the file? (I didn't create it myself -- it's data downloaded from a site whose entire history is kept in one big .xml file.)

Edit: Is there any way to lift Text Editor's file size limit?
atorch is offline   Reply With Quote
Old March 16th, 2008   #4
jaakan
A Carafe of Ubuntu
 
jaakan's Avatar
 
Join Date: Feb 2006
Location: Maryland, USA
Beans: 136
Ubuntu Karmic Koala (testing)
Send a message via AIM to jaakan Send a message via Yahoo to jaakan
Re: How do I open a 2.5 gig .xml file?

you need to import that in to a database like mysql or postgresql and just run queries against them.
jaakan is offline   Reply With Quote
Old March 17th, 2008   #5
lavinog
May the Ubuntu Be With You!
 
Join Date: Jun 2006
Beans: 1,657
Re: How do I open a 2.5 gig .xml file?

what happens if you use head?
Code:
head myxmlfile.xml
(do this in a terminal)

or does this work?
Code:
 less myxmlfile.xml
gedit?
lavinog is offline   Reply With Quote
Old March 17th, 2008   #6
bruce89
Tall Cafè Ubuntu
 
bruce89's Avatar
 
Join Date: Apr 2005
Location: Glasgow, Scotland
Beans: 2,488
Send a message via MSN to bruce89
Re: How do I open a 2.5 gig .xml file?

Jings, is that the OpenStreetMap planet file? Can't be, it's 3.7 GB compressed with bzip.
__________________
GNOME en_GB committer.
bruce89 is offline   Reply With Quote
Old March 17th, 2008   #7
atorch
Just Give Me the Beans!
 
Join Date: Apr 2006
Location: Paris & California
Beans: 76
Ubuntu 9.04 Jaunty Jackalope
Re: How do I open a 2.5 gig .xml file?

Quote:
Originally Posted by jaakan View Post
you need to import that in to a database like mysql or postgresql and just run queries against them.
Sorry to be a total nublet, but how do I do that?

Google has led me here:
http://codeghar.wordpress.com/2007/1...-gutsy-gibbon/

So I ran these commands:
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install mysql-admin
sudo apt-get install mysql-query-browser

Now under Applications > Programming I find:
MySQL Administrator
MySQL Query Browser

But both those applications seem to be made to connect to databases on other computers... how do I use them to open an .xml file on my own desktop? (If it is at all possible to do so...)

Edit: Or, how do I convert .xml into a format the MySQL works with?

(As you can probably tell, I have at best a very very vague idea of what MySQL is.)
atorch is offline   Reply With Quote
Old March 17th, 2008   #8
atorch
Just Give Me the Beans!
 
Join Date: Apr 2006
Location: Paris & California
Beans: 76
Ubuntu 9.04 Jaunty Jackalope
Re: How do I open a 2.5 gig .xml file?

Quote:
Originally Posted by lavinog View Post
what happens if you use head?
Code:
head myxmlfile.xml
(do this in a terminal)

or does this work?
Code:
 less myxmlfile.xml
gedit?
head
yes, but it seems to be opening only the the first few lines of the file. (The header?)

less
yes, this works, and I can use the down arrow to move through the file.

the problem with both head and less is that they open the file without any formatting... but at least I know the file opens and isn't corrupted or something

gedit does *not* work, it tells me the file is too big, just like Text Editor did. in fact, gedit seems to be the same as Text Editor
atorch is offline   Reply With Quote
Old March 17th, 2008   #9
jflaker
Ubuntu Extra Shot
 
jflaker's Avatar
 
Join Date: Aug 2007
Location: Long Pond, PA
Beans: 391
Ubuntu 9.04 Jaunty Jackalope
Lightbulb Re: How do I open a 2.5 gig .xml file?

MySql 6.0 seems to have an implementation of Load XML......based on Load Data..

http://dev.mysql.com/doc/refman/6.0/en/load-xml.html

I may be worth playing with the new version just to get your data into a DB so you can do something useful with it. There is no mention of max file size for the XML

Good luck
__________________
[b]Before Executing commands, understand WHAT you are doing and WHY. Some Commands can be VERY dangerous if you are uninformed!
jflaker is offline   Reply With Quote
Old March 18th, 2008   #10
lavinog
May the Ubuntu Be With You!
 
Join Date: Jun 2006
Beans: 1,657
Re: How do I open a 2.5 gig .xml file?

Quote:
Originally Posted by atorch View Post
head
yes, but it seems to be opening only the the first few lines of the file. (The header?)

less
yes, this works, and I can use the down arrow to move through the file.

the problem with both head and less is that they open the file without any formatting... but at least I know the file opens and isn't corrupted or something

gedit does *not* work, it tells me the file is too big, just like Text Editor did. in fact, gedit seems to be the same as Text Editor
Well what information are you trying to view?
less gives you the same output notepad would.
I also don't think firefox makes it much better.

it looks like tools such as grep and sed would also work
you can use:
Code:
split -l 5000 myxmlfile.xml newxml
this would split up the xml file into smaller files
you can change 5000 to whatever number of lines you need
there is a way to split it up at every occurance of a certain word using csplit

Last edited by lavinog; March 18th, 2008 at 11:52 AM..
lavinog is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:02 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry