How to read large text file on windows?

Text FilesText EditorLarge Files

Text Files Problem Overview


I have a large server log file (~750 MB) which I can't open with either Notepad or Notepad++ (they both say the file is too large).

Can anyone suggest a program (for Windows) that will only read a small part of the file into memory at a time?

Or do I need to write my own app to parse this file?

Text Files Solutions


Solution 1 - Text Files

try this...

Large Text File Viewer

By the way, it is free :)

But, I think you should ask this on serverfault.com instead

Solution 2 - Text Files

If all you need is a tool for reading, then this thing will open the file instantly http://www.readfileonline.com/

Solution 3 - Text Files

use http://emeditor.com">EmEditor</a>;, it's pretty good, i used it to open a file with more than 500mb

Solution 4 - Text Files

The integrated Text-Viewer of Total Commander can open huge files (>10GB) for viewing without any problems. It also provides different views, e.g. a Hex-View.

Solution 5 - Text Files

Definitely EditPad Lite !

It's extremely fast not just while opening files, but also functions like "Replace All", trimming of leading/trailing whitespaces or converting content to lowercase are very fast.

And it is also very similar to Notepad++ ;)

Solution 6 - Text Files

I have been using the BareTail for quite some time for viewing large logs (some GBs) and it is working very well is very fast. There is a free version and a commercial Pro version.

They say that it has

  • Real-time file
  • Optimised real-time viewing engine View files of any size (> 2GB)
  • Scroll to any point in the whole file instantly
  • View files over a network
  • Configurable line wrapping
  • Configurable TAB expansion
  • Configurable font, including spacing and offset to maximise use of screen space

Another alternative is Far Manager. Viewing a several GBs file is no problem (little memory footprint), but attempting to open the text file in the Editing mode might take several GBs of RAM, so be aware of that. I am not aware of the file size limit that can be viewed/edited in Far.

Solution 7 - Text Files

Solution 8 - Text Files

I just used less on top of Cygwin to read a 3GB file, though I ended up using grep to find what I needed in it.

(less is more, but better.)

See this answer for more details on less: https://stackoverflow.com/a/1343576/1005039

Solution 9 - Text Files

if you can code, write a console app. here is the c# equivalent of what you're after. you can do what you want with the results (split, execute etc):

SqlCommand command = null;
try
{
    using (var connection = new SqlConnection("XXXX"))
    {
        command = new SqlCommand();
        command.Connection = connection;
        if (command.Connection.State == ConnectionState.Closed) command.Connection.Open();
        // Create an instance of StreamReader to read from a file.
        // The using statement also closes the StreamReader.
        using (StreamReader sr = new StreamReader("C:\\test.txt"))
        {
            String line;
            // Read and display lines from the file until the end of 
            // the file is reached.
            while ((line = sr.ReadLine()) != null)
            {
                Console.WriteLine(line);
                command.CommandText = line;
                command.ExecuteNonQuery();
                Console.Write(" - DONE");
            }
        }
    }
}
catch (Exception e)
{
    // Let the user know what went wrong.
    Console.WriteLine("The file could not be read:");
    Console.WriteLine(e.Message);
}
finally
{
    if (command.Connection.State == ConnectionState.Open) command.Connection.Close();
}

Solution 10 - Text Files

I hate to promote my own stuff (well, not really), but PowerPad can open very large files.

Otherwise, I'd recommend a hex editor.

Solution 11 - Text Files

While Large Text File Viewer works great for just looking at a large file (and is free!), if the file is either a delimited or fixed-width file, then you should check out File Query. Not only can it open a file of any size (I have personally opened a 280GB file, but it can go larger), but it lets you query the file as though it was in a database as well, finding out any sort of information you could want from it.

It is not free though, so it is more for people that work with large files a lot, but if you have a one-off problem, you can just use the 30-day trial for free.

Solution 12 - Text Files

GnuUtils for Windows make this easy as well. In that package are standard UNIX utils like cat, ls and more. I am using cat filename | more to page through a huge file that Notepad++ can't open at all.

Solution 13 - Text Files

You should try TextPad, it can read a file of that size.

It's free to evaluate (you can evaluate indefinitely)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionnedludView Question on Stackoverflow
Solution 1 - Text FilesDaniel SilveiraView Answer on Stackoverflow
Solution 2 - Text FilesoabarcaView Answer on Stackoverflow
Solution 3 - Text FilesRamesh BelludiView Answer on Stackoverflow
Solution 4 - Text FilessaplView Answer on Stackoverflow
Solution 5 - Text FilesLihOView Answer on Stackoverflow
Solution 6 - Text FilesAlex TereshenkovView Answer on Stackoverflow
Solution 7 - Text FilesJP AliotoView Answer on Stackoverflow
Solution 8 - Text FilesGustav BertramView Answer on Stackoverflow
Solution 9 - Text FilesletimokView Answer on Stackoverflow
Solution 10 - Text FilesNathan OsmanView Answer on Stackoverflow
Solution 11 - Text FilesJeffrey HarmonView Answer on Stackoverflow
Solution 12 - Text Filesmike SView Answer on Stackoverflow
Solution 13 - Text FilesAlbertoPLView Answer on Stackoverflow