LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Editor that I can use with very long files? (https://www.linuxquestions.org/questions/linux-newbie-8/editor-that-i-can-use-with-very-long-files-672318/)

JMCraig 09-25-2008 10:36 AM

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

i92guboj 09-25-2008 10:41 AM

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.

JMCraig 09-25-2008 11:06 AM

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

JMCraig 09-25-2008 11:14 AM

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.

amani 09-25-2008 12:00 PM

Best thing would be to write a script for that... unless you have to manually look at it!

i92guboj 09-25-2008 12:11 PM

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.

JMCraig 09-25-2008 01:00 PM

Thanks, folks!

Went the scripting route.

dasy2k1 09-25-2008 03:59 PM

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


All times are GMT -5. The time now is 11:47 AM.