[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Long text file to edit..



On 17-Jul-98 Carlos Marcos Kakihara wrote:
>       I want to edit a 700MB text file. vi tells that the file is
> too long, and xemacs tells that "maximum buffer size something.." :)
>       There is a way to view this file?

Ehh?? Are you sure it's 700MB?? And are you sure it's a pure plain text file?
And, if so, have you thought about what that corresponds to? (And the same
question to the other contributors to this thread).

The average page of a typical book contains about 2K characters (or 8K for a
very big page in small type like old editions of the Encyclopaedia Britannica).
So you're thinking of !editing! the equivalent of 350K normal pages, i.e. about
the content of about 700 thickish paperbacks or about 100 volumes like the E.B.
???

Doing this by eye and hand, or even merely reading it, is not a realistic
project, I think, unless you have several years ahead of you. At <= 80
char/line, there are >= 9 million lines. I just timed a "cat" of 8k lines at 22
seconds. Just to "cat" such a file would take over 22000 seconds, or > 6 hours.
"There is a way to view this file?" you ask: even if you can scan it at 0.1
seconds per line, you are in for 1,000,000 seconds or about 30 9-hour days;
at 2 secs/line, it would take about 2 years, or more.

What sort of file is this?

Maybe it is an ASCII dump of a database, and you need to make a few known
changes to it. In that case, try awk or perl and pipe the file through a script.
It may take many hours to work from one end to the other, but at least that is
a practical proposition, allowing you to get on with something else and keep
your sanity. Assuming you have the disk space, of course.

If you need to reflect on each line before deciding what to do about it, then
surely there is no realistic prospect of getting the job done. The above
questions need an answer before any sensible advice can be given about how to
handle such a file.

Good luck, and best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk>
Date: 19-Jul-98                                       Time: 00:23:59
--------------------------------------------------------------------


--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: