How to open a huge HTML file?

5

3

I have a report in an HTML file that is over 230 MB -- it's huge!

I need to open it somehow; I tried Mac (Safari), Firefox (Win32 and Ubuntu), Windows Explorer (Windows XP), notepad2 (Windows XP), but nothing seem to open it...

Any ideas how I can open it or split it into several files and open it?

PSS

Posted 2011-04-21T17:38:15.937

Reputation: 163

By "open", did you mean view or edit? I have just opened a request for a huge HTML file viewer (editing not necessary) on software recommendations (which did not exist when this question was asked).

– Mawg says reinstate Monica – 2018-09-12T07:11:35.353

1a 230MB HTML file..are you sure? If it is generally that size it might be that it's being read, so open the file and wait about 10 minutes as a guess and see what the output is. – Sandeep Bansal – 2011-04-21T17:46:01.370

possible duplicate of Is there a text editor for very big files?

– James Mertz – 2012-07-02T07:28:53.667

Answers

2

On a Mac or Ubuntu box the split command does exactly what you want. The easiest way to use it is with the -l (lines) argument.

  1. Open a terminal window.
  2. cd to the directory where your giant file lives.
  3. Type:

    split -l 5000 filename
    

    where "filename" is the name of your file and 5000 is the number of lines you want in each piece of the file.

  4. Your files will be named xaa, xab, etc. by default.

Joel Spolsky

Posted 2011-04-21T17:38:15.937

Reputation: 1 764

3

The Unix utility less does not need to read the entire file to open it.

less myfile.htm

You can use and to scroll, Q to quit.

The split command can also split a many-lined file into separate files:

elliot42

Posted 2011-04-21T17:38:15.937

Reputation: 271

3

Use Opera. I've successfully opened .html files larger than that using Opera.

  Opera (web browser)
  http://www.opera.com/

There will be an initial delay during loading (because the file is unusually large), but after that all should be well as long as your system isn't low on memory.

If your OS is lousy at dealing with large files, one fix is to install Apache HTTPd to run as a local daemon and then place the 230 MB .html file in the DocumentRoot. From there, you should be able to load it with Opera or Firefox relatively quickly (and probably faster than as a local OS-based file) using something like http://localhost/filename.html as the URI; I use this trick to load large .html files faster under Windows.

Randolf Richardson

Posted 2011-04-21T17:38:15.937

Reputation: 14 002

2

Try vim. I've used it to open much bigger files than this.

Peltier

Posted 2011-04-21T17:38:15.937

Reputation: 4 834

2

To open in in a Windows text editor program such as UltraEdit or Notepad++ , disable the line-numbering and bookmark margin before opening the file. Line number slows down some text editors.

djangofan

Posted 2011-04-21T17:38:15.937

Reputation: 2 459

1

I'd try to open it in a text-editor like e-texteditor or notepad++ on windows or bbedit or textmate on a mac. These usually will open files that size. From there you can try and split it into smaller pages.

Korneel Bouman

Posted 2011-04-21T17:38:15.937

Reputation: 211

-2

A 230 MB HTML file sounds very, very unlikely unless it was created by a script or program. You do mean just a plan HTML file, not an MHT or something, which might contain graphics or movies?

Try the Unix "file" command to see if it's really HTML, or just "less" as elliot42 suggested.

CarlF

Posted 2011-04-21T17:38:15.937

Reputation: 8 576