Text editor to edit large (4.3 GB) plain text file
Is there any text editor, which can edit such file?
Do you need to edit it or just view? If the latter, you can simply use "less" from CLI.
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.
By any chance are you trying to open the 42 zip bomb base file? I had this problem and I found that a program called "010 editor" worked well
Am faced with the same problem right now. Just made the switch to Linux from Windows, and to my horror (and surprise), nothing seems to be nearly as good at opening/editing gigantic .txt files as the Windows-only EmEditor. So, terrible as it seems, I am now running EmEditor in a vm inside VirtualBox, and it works pretty well. I just opened a 2.5GB txt file, and EmEditor opened it immediately. I was able to do editing pretty fast (not at native speed, but not too annoying). Adding large chunks of text, F&R, etc.
Another method is to use
split. Split the file into 8 pieces 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
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?* http://askubuntu.com/q/20871/2670
nice way ... and then you should use vim with the single parts ... I hate vim :P but It win all other editor here
@Peter.O: Did the link change? I'm having a hard time finding info on the newline character issue at that URL. :/ Update: Found the referenced question here: http://askubuntu.com/q/13317/372950
This is the only working method as well as the one suggested by @rinogo, nano is honestly the most fast and reliable editor to work with. Each of the rest is either complicated or bloated or have its own anti-features.
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).
Tried on a 14G SQL dump file, but failed with an IO error. (machine has 3GB RAM and 3GB Swap).
gave joe a 4.6gb file, and nothing happened for a few minutes, so gave up Hex Fiend opens it instantly, but does not seem you can edit in it
you will not find them. If you want to replace some lines in this file, you can look at with
lessor grep and use
sedto search and replace some lines.
sed -e 's/oldstuff/newstuff/g' inputFileName > outputFileName
on Wikipedia are some useful examples: http://en.wikipedia.org/wiki/Sed
Or especially with the `-i` flag (in-place), so it behaves essentially like a text editor that will replace the original file content.
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,
joinwould 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
@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)...
@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.....
You seem to have changed the first link to be the same as the second, rather than to "how to stop gedit, etc from adding end of file newline".
Use glogg - the fast, smart log explorer: http://glogg.bonnefon.org/
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.
There is another very simple and fast way to replace content in very large files (which works instead of editing large mysql dumps)
First of all you should install midnight comander - great file manager for linux systems
sudo apt-get install mc
After that you may open any file of any size in "view mode" (with F3 shortcut), switch to HEX view (F4 shortcut) and activate edit mode (F2 shortcut).
For example, I had 3 GB mysql dump, where I want to remove some SQL line. I open view mode, find string, open hex mode and replace content before needed line with MYSQL comment (string "-- ", hex codes 2D 2D 20).
@Andron well, I already described that in my answer. :) Open view mode, hit F4 for hex and replace any content in any file no matter on size.
nedittext editor has been around a long time and is quite capable. It can open a 1.9Gb text file in about 20 seconds. It's a windows-like graphical interface with all the standard text editing features you'd expect like syntax highlighting, indenting, line numbering, and so on.
If you want to resize the window, do that before opening the large file. The X11 Motif is a bit slow on the resize, but it's also a taxing request.
It's in all the standard repositories, so install with:
sudo apt-get install nedit
It is GPLv2 open source.
I'm wading through 30-40Mb text files and
nedithandles them easily.