Normally when I want to browse a file I use a text editor. However, many text editors load the entire file into memory and I need to browse a 2 GB file. Specifically, I need to capture a few screens of text after the second occurrence of the string TRAP.
A secondary issue is that the file is likely to contain multiple occurrences of zero bytes (it’s an OS/2 dump and the room my OS/2 system is in currently has no power.)
have you considered using a hex editor like Okteta (KDE) or GHex (Gnome)
Hex editors usually load files from disk and support large files and as your files are not text files but dumps a hex editor seams like a better choice
you could also try mc’s (Midnight Commander) build in viewer/editor as it’s a lot faster then kate/kedit/gedit or use a console editor like vim
install mc run it then select the file and hit F3 or F4 mc is not installed by default but it’s in the main repos
well, 2G is not that big. I take it you already tried grepping the file and it came back as binary, right?
Unless you want to split the file, I suggest using vi. It does a fairly good job at very large files and it will not modify them when it comes to line endings and special chars.
Just for the fun of it I pointed it at a 10G file. It took about a minute to load but then was perfectly browsable while using about 4G of RAM.
*NIX utilities usually stream instead of loading the entire file.
In fact, last week I ran into a Microsoft KB article that required reading the contents of an extremely large text fileon MSWindows. Guess what tool they wanted you to use? VIM.
Use the F3 and F7 keys in MC the same way you would use the them in FC/2. All my file browsing and most of my editing on OS/2 is with FC/2, while on Linux it’s a relatively even split between MC and FC/L.
A secondary issue is that the file is likely to contain multiple occurrences of zero bytes (it’s an OS/2 dump and the room my OS/2 system is in currently has no power.)
Given power to the OS/2 PC or HD, I’d probably copy the dump to another filename, then try F4 instead of F3. If it refuses to edit, then I’d F3, switch to another vtty, and either copy the content of /dev/vcs# to a file, then put newlines in that saved file where needed, or try a screencap of the F3 screen or window. If the “screens” of the dump literally take more than one screen, I’d configure Xorg with a (panning) virtual desktop 3 or more screens tall to fit the needed dump portion, then get a screenshot of a window using the full screen height. For the general idea e.g. http://fm.no-ip.com/SS/brunosFontDefaults1406-180L2.png 2880 px tall.
Given power to the OS/2 PC I’d probably use DFSee or Gamma Tech Utilities, and I’d have a decent keyboard instead of the awful layout that the laptops have. But MC did the job once I googled for text select. Thanks.