How do you edit a 862 MB Text File on a Mac?

Right… so I have this large large large text file. 862 MB. And I wanted to change the first few lines in it.

First I tried the usual editors… BBEdit, Coda, TextMate, TextWrangler etc. All crashed and burned.

Then went into Terminal to give the text-based editors a try. And to my amazement (and much joy) the file opened up in both Pico and vi. Although it took 30-odd seconds before the text showed up on the screen, but once it was there, I could scroll around and edit. And saving the file was pretty quick as well.

Long live command line!

4 thoughts on “How do you edit a 862 MB Text File on a Mac?”

  1. See this is a great example of the type of peripheral activity that a developer might have to carry out and suddenly find that it’s much more difficult on a mac than on a pc. PC users have had freeware apps like TheGUN forever that can manage hundred gigabyte log files.

    It’s for these reasons that I will always need a PC to hand, even when developing for iPhone on Mac.

    Clark

  2. 🙂

    You might have a point. However, there are quite a few other “peripheral” activities like the ability to run Linux and Windows right inside Mac OSX, that a developer can do on a Mac, which just is not possible on Windows.

    Also, given that the command line editors on *nix support something like opening large files. You don’t need any other software.

    I guess it comes down to what one is used to and prefers.

  3. I’d concur with Indy’s point – being able to drop down into Unix is something that should be in every developers armory, and is a frequent frustration of mine when running Windows (of course there is Cygwin, and PowerShell brings a similar approach, but as optional installs they aren’t always present).

    Similar issues also exist with text editors on Windows – code editors, from Textmate to pfe – are more part-way to an IDE – their strength comes from parsing the lexical elements of the file into memory.

    It’s possible similar tools to TheGUN exist on OS X, but personally I’ve not really looked – ditto at AquaMacs (native emacs) or the native version of VIM. If it’s too big for Textmate, then it’s straight down to vi, rather than something inbetween.

  4. If you want to stick to GUI, you can always do gvim (for the Mac, MacVim) or emacs. Personally, I love the ‘console’, and I still hand-code HTML in vi 😉

Leave a Reply

Your email address will not be published. Required fields are marked *