Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I read a text file of about 2 GB? [duplicate]

People also ask

How can I open more than 1gb text file?

Solution 1: Download a Dedicated Large File Viewer If all you need to do is read the large file, you can download a dedicated large file viewer such as the Large Text File Viewer. Such tools will open large text files with ease.

How do I read 2 GB files in Python?

In Python, files are read by using the readlines() method. The readlines() method returns a list where each item of the list is a complete sentence in the file. This method is useful when the file size is small.

What editor can open large files?

Modern editors can handle surprisingly large files. In particular, Vim (Windows, macOS, Linux), Emacs (Windows, macOS, Linux), Notepad++ (Windows), Sublime Text (Windows, macOS, Linux), and VS Code (Windows, macOS, Linux) support large (~4 GB) files, assuming you have the RAM.


Try Glogg. the fast, smart log explorer.

I have opened log file of size around 2 GB, and the search is also very fast.


WordPad will open any text file no matter the size. However, it has limited capabilities as compared to a text editor.


Instead of loading / reading the complete file, you could use a tool to split the text file in smaller chunks. If you're using Linux, you could just use the split command (see this stackoverflow thread). For Windows, there are several tools available like HJSplit (see this superuser thread).


I use UltraEdit to edit large files. The maximum size I open with UltraEdit was about 2.5 GB. Also UltraEdit has a good hex editor in comparison to Notepad++.


EmEditor works quite well for me. It's shareware IIRC but doesn't stop working after the license expires..


I always use 010 Editor to open huge files. It can handle 2 GB easily. I was manipulating files with 50 GB with 010 Editor :-)

It's commercial now, but it has a trial version.