66

What are your recommendation for opening large text files on OS X? I found both BBEdit and Textmate to be struggling in this department.

nohillside
  • 100,768
nanda
  • 1,527
  • 1
    there's a dup of this on stackoverflow: http://stackoverflow.com/questions/952886/editing-large-files-on-mac-os-x – Robert S Ciaccio Oct 25 '10 at 18:58
  • (That SO question should probably be moved to Super User or here :) – Jonik Oct 26 '10 at 17:15
  • 1
    The 64bit version of Emacs should also be pretty good when opening such big files. – Gio Jan 16 '12 at 10:46
  • How big is the file you are trying to load? Textmate is terrible with large files, especially files with long lines. I've never had any problem with BBedit opening 10s of Mbyte files. – Henry Oct 26 '10 at 22:20
  • 4
    Define "large". Usually it becomes interesting when the files does not fit in available memory. – Thorbjørn Ravn Andersen Apr 24 '13 at 11:35
  • Personally I have BBEdit (that I love and use every day) struggling on a 586MB sql file, so that might be my current definition of large. – FrancescoMM Nov 21 '17 at 14:09
  • 1
    Very old thread, but pointing out that BBEdit (and TextMate) are both 64-bit now. BBEdit, in particular, will have no problem with the 500+ MB file described above. – Marc Wilson Aug 11 '18 at 16:01

10 Answers10

51

I'm using HexFiend to work with a 60 GB text file and it works great (apparently it can handle files as large as 118 GB).

PaulCapestany
  • 621
  • 5
  • 4
  • 1
    Hex Fiend is way faster than VIM on the command line and blows less or more away. Especially for multi-gigabyte single-line text files. Recommended. – Brent Faust Aug 30 '15 at 05:14
  • 1
    +1 I just tried hex fiend on the strength of this rec and it snarfed up a 3+gb inbox archive like instantly, and then successfully searched through the whole thing for a word in under 20 seconds. – Paul Gowder Jan 22 '16 at 15:47
  • 2
    this could be the notepad++ or even better but needs some tweeks. It just prints whatever there in the file no matter of new line or not. I will see if I can make some changes on my freetime to make it taking consideration of new lines. – Olgun Kaya Jun 19 '17 at 04:53
  • 8
    Yeah but it ignore line breaks :( – Gerry Jun 20 '18 at 01:44
  • 2
    Neat, small and super fast. But I agree with the last comment: it doesn't really work as replacement for a text editor, when you want to look at well, line based text files. Too bad, a single checkbox that says "show by lines" or something would make it a perfect tool. – GhostCat Nov 06 '18 at 13:04
  • This works, but the line break issue is really annoying – Andrew Alexander Jan 18 '20 at 21:11
  • Cannot handle UTF-8... https://github.com/ridiculousfish/HexFiend/issues/247 – PatrickT Jun 17 '20 at 03:26
  • If you want something like HexFiend but for text / logs with line breaks, and similarly something that doesn't attempt to load the whole file to memory, klogg works very well: https://github.com/variar/klogg (free and open source) – RestOfTheBothWorlds Dec 11 '21 at 03:45
24

I found MacVim pretty good at opening large files.

There's even a plugin to speed it up, if the file is really large.

(If you don't want to compile it yourself, you can download a DMG to install it pre-built.)

Loïc Wolff
  • 14,706
9

BBEdit is pretty much the standard for opening large text files on a Mac. I've opened some good-sized files with it, and BBEdit didn't even break a sweat. It is not entirely free - you do not have to pay for a license unless you want features that are in the pro activation above and beyond the free license.

How large of a file are you talking about? And how much RAM does your Mac have (both installed and free)?


Edited to add…

Bare Bones released BBEdit 9.6 today, and according to the Release Notes1 (under Changes):

It is now possible to open files significantly larger than before; the ceiling isn't unlimited, but it is no longer limited by the previously extant constraints in the OS.

Sounds to me like it's worth upgrading (free for anyone with BBEdit 9.x) and trying again.

1 If you've never read a Bare Bones release notice before, you should. Even if you have no interest in BBEdit. Even if you have no interest in Bare Bones. Even if you have no interest in text editors in general. They're that good. Yes, really. Iä! Iä! Pnoies fhtagn!

bmike
  • 235,889
Dori
  • 7,235
  • 1
  • 33
  • 40
  • +1 for recommending BBEdit and "Iä! Iä! Pnoies fhtagn!". My favorite so far is "The ponies' saronite shoes have been reinforced with titanium, and have a buff applied which increases both ground and flight speed by 30%." – Philip Regan Oct 26 '10 at 22:48
  • I reviewed a previous version of BBEdit for Macworld, and was sorely disappointed that I wasn't allowed to put "No actual ponies" under the Cons section. – Dori Oct 26 '10 at 22:50
4

Check Sublime Text 2 out. It is one of the best out there.

bassplayer7
  • 14,106
mencina
  • 41
  • 1
    And Sublime Text 3 more faster then previous version. – Vetal4eg Apr 24 '13 at 09:11
  • 11
    I've been working with a 1.37 GB log file generated by parsing a 13 GB binary file, and both versions of Sublime Text have been unimpressive. They took a minute or more to open the file, and trying to type in search strings resulted in temporary spinning-pizzas-of-death while the program was doing unrequested searches on my partially-typed text. 010 Editor, although it has a clunky interface, is quite fast and stable in comparison. – Bob Murphy Jun 18 '14 at 21:58
  • 2
    Sublime Text is nice for medium size files but if you try to open a 50GB file (having 12GB RAM) it crashes. – skan Oct 14 '16 at 19:28
3

TextWrangler is a great tool for opening editing and saving large files. I wouldn't recommend if for copying and pasting large amounts of content though. Use it if you don't want to have to deal with the vi interface/commands. Like Loic mentioned, MacVim is a great app if you're more familar with vi.

Use BBEdit for free now that TW is discontinued if needed.

bmike
  • 235,889
  • 2
    Given that TextWrangler is BBEdit's little brother, I'd guess that someone who is already using BBEdit won't find anything new there. – Dori Oct 26 '10 at 21:38
2

If you are dealing with files over 2 GBs I recommend 010 Editor. It won't load the entire file in memory which means you can use it to open files larger than your available RAM and opening times will be much shorter (took about 20 seconds to open a 7GB file).

2

If you are reading the file only, use the less command. You can navigate and search through the file like vi, but much faster and without the nasty 'line too long' type problems. For working with big production logs, this is an invaluable tool.

Ricardo
  • 406
1

For me, where BBEdit choked on 750MB, UltraEdit (not free) worked satisfactorily fast.

MastaBaba
  • 187
1

My first choice is SlickEdit. It looks, well, is a bit old fashioned, but I have seen no other editor that deals with large files (even GBs of text) that fast, and still giving a ton of features.

It is not a modern IDE by current day standards, but a really powerful editor, and as said, the only one I ever used that really works with large files.

GhostCat
  • 967
  • $100 !! wow how do these companies justify that. I use Webstorm all the time and it's about that much but it's a full-fledged IDE. – jcollum Oct 06 '22 at 23:56
  • 1
    @jcollum I would rate SlickEdit as "legacy" "enterprise" product, cash cow like. Meaning: It would really need a major overhaul, as it is in many areas no longer up to free/much cheaper competition. But that doesn't happen ... so it is slowly dying I guess. I definitely do not use it for code development. But my company still pays for the licence, so I keep it around ... as said: even in 2022, products like Visual Studio code have issues when you go for files in the GB range. Whereas I easily worked with 20 GB files on AIX 12 years ago with Slick Edit. – GhostCat Oct 07 '22 at 06:53
0

http://code.google.com/p/macvim/ worked with a 1 gig file searching file took about 1 min