unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: What's your favourite *under_publicized* editing feature of Emacs?
Date: Fri, 18 Feb 2011 11:09:33 +1100	[thread overview]
Message-ID: <87lj1e6w5e.fsf@rapttech.com.au> (raw)
In-Reply-To: xeiaei77szj3.fsf@kobe.laptop

Giorgos Keramidas <keramida@ceid.upatras.gr> writes:

> On Sat, 29 Jan 2011 09:02:14 -0600, Perry Smith <pedzsan@gmail.com> wrote:
>> This thread is beginning to drift a bit... but something I wish I had
>> was a way to view a file without loading all of it.  I look at hugh
>> trace files and I have to get out of emacs and start a shell so I can
>> use more / less.
>>
>> The shame of it all! ;-)
>>
>> I don't know of such a critter.  If there is one, that would be super
>> cool.
>
> If there was some way to lazy-load files, I'd be happy too.
>

Many years ago I needed to load large trace files from Oracle. I just
looked and seem to have lost the code I used, but you may find the
approach useful. This was done on a Linux box and uses standard Linux
utilities. 

The basic approach I used was to write some elisp functions that created
a temporary directory, applied the 'split' program to the input file,
split the input file into manageable chunks (split will/can add a
prefix/suffix to sequence/number the chunks) and put them into the temp
directory and then open the first chunk in a buffer. I could then run
dired, which would list al the chunks and open any one of those chunks
for viewing further chunks of the file. 

I also used a defadvice around view-file which automated the process if
the file suffix was .trc. I always planned to clean it up and add a few
extra features (such as not splitting the file if it had already been
split before etc), but then my job changed a bit and I no longer had the
need to view such large trace files.

It worked quite well. Maybe not as clean as jus having a 'lazy file
read', but did mean I could view these large files from within emacs and
setting things up was largely automated. I do vaguely remember having to
play with split a bit before I got things just right. Later I added a
command that would use sed to replace strings in really large files,
which was useful when migrating large oracle databases and you wanted to
modify the paths in order to refresh a dev version with data form a
production system. Again, can't find that code as we now do things
differently and I've not kept it.

Tim


-- 
tcross (at) rapttech dot com dot au


  parent reply	other threads:[~2011-02-18  0:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.0.1296117403.8303.help-gnu-emacs@gnu.org>
2011-01-28  9:54 ` What's your favourite *under_publicized* editing feature of Emacs? Simón Ortiz
2011-01-28 21:22   ` Ken Goldman
     [not found]   ` <mailman.21.1296249764.1176.help-gnu-emacs@gnu.org>
2011-01-28 22:59     ` Stefan Monnier
2011-01-29 14:46       ` Oleksandr Gavenko
2011-01-29 15:00         ` Eli Zaretskii
2011-01-29 15:02         ` Perry Smith
     [not found]         ` <mailman.10.1296313340.8933.help-gnu-emacs@gnu.org>
2011-01-29 16:08           ` Stefan Monnier
2011-02-17 10:53           ` Giorgos Keramidas
2011-02-17 13:43             ` Perry Smith
2011-02-17 14:01               ` Thien-Thi Nguyen
     [not found]               ` <mailman.9.1297951684.6316.help-gnu-emacs@gnu.org>
2011-02-17 19:04                 ` view/edit large files (was: What's your favourite *under_publicized* editing feature of Emacs?) Ted Zlatanov
2011-02-18  0:09             ` Tim X [this message]
2011-01-29 12:55 ` What's your favourite *under_publicized* editing feature of Emacs? Javier Sanz
2011-02-06 20:11   ` Oleksandr Gavenko
2011-02-08 23:10     ` Oleksandr Gavenko
     [not found]     ` <mailman.11.1297206657.16135.help-gnu-emacs@gnu.org>
2011-02-09  4:37       ` Stefan Monnier
2011-02-09 20:51         ` Oleksandr Gavenko
2011-02-09 21:31         ` Oleksandr Gavenko
2011-02-09 22:32           ` Thien-Thi Nguyen
2011-02-14 20:44             ` Oleksandr Gavenko
     [not found]         ` <mailman.10.1297284733.9144.help-gnu-emacs@gnu.org>
2011-02-10 17:24           ` Stefan Monnier
2011-03-01 21:30 What's your favourite *under_publicized* editing feature ofEmacs? Cthun
2011-03-02  1:00 ` What's your favourite *under_publicized* editing feature of Emacs? Steve
2011-03-02  5:34   ` PJ Weisberg
  -- strict thread matches above, loose matches on Subject: below --
2011-01-27  8:33 Le Wang
2011-01-27  9:29 ` Deniz Dogan
2011-01-27 12:03 ` Wang Lei
2011-01-27 14:13   ` suvayu ali
2011-01-27 14:12 ` Ken Goldman
2011-01-27 18:11 ` Erik Iverson
     [not found] ` <mailman.0.1296137574.27610.help-gnu-emacs@gnu.org>
2011-01-27 22:23   ` Joe Fineman
2011-01-28  6:40     ` Jason Rumney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lj1e6w5e.fsf@rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).