LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-25-2008, 10:36 AM   #1
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Rep: Reputation: 15
Question Editor that I can use with very long files?


Hi Folks,

I'm trying to make some changes to an extremely long file (hundreds of MB). Is there some kind of editor that will efficiently deal with a file of that size and allow me to make the changes, and then save them without it taking hours (as it seems to be doing with vi)? I tried to save it with nano, I think it was, last night and it crashed the computer! Not something I expected from Linux....

Thanks!

John
 
Old 09-25-2008, 10:41 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Strange, at most is should have crashed nano (nano is not the most stable program, that's old news).

I really wonder what do you have inside a many hundred mb's text file. It's not the most optiomal format to store big chunks of information. But that's another topic.

Kate is said to work well with these, but, sincerely, if you need to load and write a file that takes many hundred mb's, no editor is going to be blazing fast. I never dealt with a similar situation with plain text files.
 
Old 09-25-2008, 11:06 AM   #3
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Original Poster
Rep: Reputation: 15
Thanks i92guboj.

FYI, the file is a dump of a Postgres DB pg_dumpall output (so it's the schema and contents of 2 moderately big DBs). I would not normally mess with a text file of this size, but it's the way I got it and short of redoing the dump using a more effective method (which I'd have to tell the guy how to do) and downloading it over again, I was hoping to find an editor that would just load a modest amount into a buffer and leave the rest out on the disk....

John
 
Old 09-25-2008, 11:14 AM   #4
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Original Poster
Rep: Reputation: 15
FYI 2: I need to comment out (or delete) some lines from the file--this kind of dump is the DB equivalent of a bare-metal restore and I am not putting it on a new Postgres install so I need to handle some of the stuff externally rather than in the script.
 
Old 09-25-2008, 12:00 PM   #5
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
Best thing would be to write a script for that... unless you have to manually look at it!
 
Old 09-25-2008, 12:11 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
I also think that scripting might be a better way to do this. You can select lines using awk, sed, grep or whatever and redirect the ones you want to a file.

Manually editing a test file of many hundred mb's is going to take you a very very long time. On the contrary, if you are only searching for patterns and deleting/substituting them, you can always automate that via scripting.

Perl is also nice and quick for this things.
 
Old 09-25-2008, 01:00 PM   #7
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Original Poster
Rep: Reputation: 15
Thanks, folks!

Went the scripting route.
 
Old 09-25-2008, 03:59 PM   #8
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Rep: Reputation: 35
you could allways try split

to chop it up into many manageable sizes,
better if you know where in the mess the lines you want are
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to read long files on the shell? Gins Linux - General 12 06-24-2007 02:07 AM
LXer: Alacarte: GNOME's long overdue menu editor LXer Syndicated Linux News 0 09-19-2006 12:03 PM
ZipSlack and files with long names Pablo88 Linux - Newbie 1 02-15-2006 06:33 PM
cp lots of files argument list too long dtra Linux - Software 4 07-07-2005 09:14 AM
Cannot print files with long filenames esael Linux - Networking 6 11-15-2002 09:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration