Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there any text editor, which can edit such file?

I've tried:

  • gedit
  • kate
  • nano
  • vim
  • mcedit

without success.

share|improve this question
4  
Do you need to edit it or just view? If the latter, you can simply use "less" from CLI. –  Mr Shunz Mar 3 '11 at 12:21
    
Have you asked yourself what you're going to do with this so big file? –  Bakhtiyor Mar 3 '11 at 22:13
2  
@MrShunz: yes, i want to edit the file. @Bakhtiyor: the answer is "YES" :) –  cupakob Mar 4 '11 at 6:14
2  
I recommend editing your question to mention the fact that you want to edit the file. That would make it so people didn't have to search through comments to figure out your question and/or if your question is similar enough to one they have. –  Firefeather Mar 9 '11 at 20:13

7 Answers 7

up vote 18 down vote accepted

another method is to use split. split the file in 8 pices and manipulate the files with a editor. After that you reassemble the files again.

split -b 53750k <your-file>

cat xa* > <your-file>


SYNOPSIS
       split [OPTION]... [INPUT [PREFIX]]

-a, --suffix-length=N
              use suffixes of length N (default 2)

       -b, --bytes=SIZE
              put SIZE bytes per output file

       -C, --line-bytes=SIZE
              put at most SIZE bytes of lines per output file

       -d, --numeric-suffixes
              use numeric suffixes instead of alphabetic

       -l, --lines=NUMBER
              put NUMBER lines per output file
share|improve this answer
    
it seems to be the best solution at the moment... –  cupakob Mar 4 '11 at 14:43
3  
Take note that many editors will add a newline character to the end of your edited file, and do it without informing you! For more info see How to stop Gedit, Gvim, Vim, Nano from adding End-of-File newline char? askubuntu.com/q/20871/2670 –  Peter.O Mar 23 '11 at 6:04
    
nice way ... and then you should use vim with the single parts ... I hate vim :P but It win all other editor here –  Postadelmaga Dec 18 '12 at 0:12

you will not find them. If you want to replace some lines in this file, you can look at with less or grep and use sed to search and replace some lines.

like this:

sed -e 's/oldstuff/newstuff/g' inputFileName > outputFileName

on Wikipedia are some useful examples: http://en.wikipedia.org/wiki/Sed

share|improve this answer
    
Or especially with the -i flag (in-place), so it behaves essentially like a text editor that will replace the original file content. –  O. R. Mapper Feb 28 at 9:17

Give it a go, if you like, but such big files become impractical if you want to do "normal" editing; eg, you don't want to go saving your edits too often; it will take too long :)

If it's for a one off, split and join would work quite well, and it is simple enough to chop it up into managable chunks, and then rejoin the pieces... Take note that many editors will add a newline character to the end of your edited file, and do it without informing you! For more info see How to stop Gedit, Gvim, Vim, Nano from adding End-of-File newline char?

Try Gvim if you really want edit such a big file.... I've just loaded a 3.9GB file into it, and all seems to be normal...

Here is an interesting link on the matter, at stackoverflow

share|improve this answer
    
doesn't work with gvim.... –  cupakob Mar 4 '11 at 14:43
    
@upakob: It just now successfully loaded a 4.5GB file on my system, using Gvim... It took 6 minutes to load. Did you wait long enough? (This is what I mean about saving the file. It will take a long time)... Try running iotop to watch its I/O stats as it is loading.. System Monitor shows I've got 3.2 GB of RAM (Which puzzles me, as I have 4 GB)... –  Peter.O Mar 5 '11 at 8:25
    
@upakob: I've tried 8GB this time, and Gvim has successfully loaded it... So Gvim can "technicllly" handle big, Bigger, and maybe even the "BIGGEST" files, but even so, it is somewhat "impractical" (unless you are like me an prepared to wait 41 minute to load 8GB.. :) ... but I don't think I'll bother doing it again..... –  Peter.O Mar 5 '11 at 9:45
    
You seem to have linked the wrong question. –  psusi Apr 22 at 14:54
    
@psusi: Thanks. I have fixed the link. –  Peter.O Apr 24 at 2:20

Try joe. I just used it to edit a ~5G SQL dump file. It took about a minute to open the file and a few minutes to save it, with very little use of swap (on a system with 4G RAM).

share|improve this answer
    
This worked well for me to edit a 1GB xml file. –  digitaljoel Mar 6 at 20:45

According to this Wikipedia article Comparison of text editors VIM among others. I was going to suggest Geany but there is a ? in the field for large file support...

EDIT: I went ahead and tried with geany and gave up after waiting 10 minutes with 3 cores pegged and basically all my memory (virtual and physical) in use the entire time... Not conclusive since it might have managed to open it if I'd been more patient. I looked for and did not find any settings/preferences for handling large files differently as well.

I like fred.bear's answer best.

share|improve this answer

Use glogg - the fast, smart log explorer: http://glogg.bonnefon.org/

share|improve this answer
    
Welcome to Askubuntu.com! Whereas the proposed package may solve the problem, please note that glogg is aimed at searching large files, not actually editing them. –  Jos Apr 22 at 15:10

i work with netbeans : it is better than eclipse in that context.

I know that it is for developers but you can ope with it any plain text file

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.