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

Re: Long text file to edit..



On 19-Jul-98 Pann McCuaig wrote:
> On Sun, Jul 19, 1998 at 12:23:59AM +0100, Ted Harding wrote:
>> 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).
> 
> Well, maybe not to actually edit, but certainly to view and search. A log
> file with a high debug level for example, used to catch an occasional and
> unpredictable oops that may happen once only every few days.

I wasn't saying a 700MB file was impossible nor that you wouldn't need to
search it for some interesting item.

I WAS demonstrating that there's no practical hope of doing such a "view and
search" job by eye and hand.

If you're searching, and know what sort of thing you're looking for, then you
might hand it over to grep, maybe "with context" as in e.g. "grep -i -n -5 ..."
which would do a case-insensitive search for a pattern, prefix each output line
with the line number in the original file, and also output the five lines
preceding and the five lines following each line matching the pattern. Redirect
this output into a file and then, if the "unpredictable oops" is sufficiently
rare, you should have a file with not too many KB in it that you can handle by
conventional means ("vim", "less", ... ).

(Note that if you have a comprehensive list of "non-oops"es, e.g. predictable
debug stuff reporting satisfactory working which you expect to get, then you
can reverse the grep so as to output NON-matching lines with the option -v; and
you can take the pattern -- which in this case might be complex -- from a file
by using the "-f filename" option. If the task is like this, then "man grep" is
a good starting point.)

But if you don't know what sort of thing you're looking for, then you haven't a
hope. It would, literally and without exaggeration, take YEARS. Surely that is
clear!

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk>
Date: 19-Jul-98                                       Time: 09:53:31
--------------------------------------------------------------------


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


Reply to: