View Full Version : Open a 10 Gb text file
stalaei
December 26th, 2011, 08:31 AM
Hi.
I have a 10 Gb text file.the default text editor in ubuntu doens't open it.
Does anyone know how can i open it??
Thanks
squenson
December 26th, 2011, 08:57 AM
Quite a large file! I suggest that you write a small program, in python or C, that will make smaller pieces of it (10 MB or so). Use a parameter which defines the beginning position in bytes. Then you can open the extract with any text editor.
hakermania
December 26th, 2011, 09:09 AM
Hello! Please read here about split: http://ubuntuforums.org/showthread.php?t=1428089
2F4U
December 26th, 2011, 09:26 AM
According to the limits on vi, it should be able to edit a file of that size:
http://vimdoc.sourceforge.net/htmldoc/vi_diff.html
The Cog
December 26th, 2011, 02:33 PM
I don't suppose you want to actually read all that file. What do you want to actually do with it? There is probably a tool that will do what you want to do better than using an editor.
Petrolea
December 26th, 2011, 02:42 PM
As suggested before, I recommend that you write a program that reads a file by chunks (you can specify the size if a chunk).
I think pretty much any programming language can do that.
Barrucadu
December 27th, 2011, 03:22 PM
You don't need to write your own program for that: as suggested by hakermania you could use `split` to break it up into small chunks; then recombine them afterwards with `cat`.
Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.