9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Andrew Simmons" <andrew@mbmnz.co.nz>
To: 9fans@cse.psu.edu
Subject: [9fans] Sam / text search query
Date: Tue, 18 Jun 2002 17:03:24 +1200	[thread overview]
Message-ID: <3D0F67DC.29863.1AC8A75@localhost> (raw)

Sorry if this is slightly OT here, but I thought it was the likeliest
place to get an answer. I have a problem I was hoping to use Sam for,
partly so that I have an incentive to get better at using the command
language, but I'm too thick to work out how to do what I want.

I have a large number of files, and for each one I need to print out
all sequences of adjacent lines such that the first line in the
sequence contains "sprintf" and the last line contains "msgprint".
Ideally there should be no other occurences of "sprintf" in the
sequence of lines, but I can live with it if there are. My naïve
attempt to do this resulted in the selection of the sequence of lines
from the first "sprintf" to the final "msgprint". Can some kind soul
point out how to do what I want, or failing that suggest an
alternative tool - I could write a program, but feel it shouldn't be
necessary.

Drifting ever more OT, has anyone had problems running Sam under
Windows 2000? It seems to start happily enough, but then gets angry
and refuses to respond to anything I type in the command window,
before finally locking up under circumstances I have not so far
managed to identify.


             reply	other threads:[~2002-06-18  5:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-18  5:03 Andrew Simmons [this message]
2002-06-18 15:03 ` Douglas A. Gwyn
2002-06-18  5:07 rob pike, esq.
2002-06-18 17:31 Gerry Tomlinson
2002-06-18 21:06 Andrew Simmons
2002-06-19 15:37 ` Douglas A. Gwyn
2002-06-19 16:08 rog
2002-06-20 15:47 ` Douglas A. Gwyn
2002-06-20 16:21 rog
2002-06-20 18:58 David Gordon Hogan
2002-06-21 15:00 ` Douglas A. Gwyn

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

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

  git send-email \
    --in-reply-to=3D0F67DC.29863.1AC8A75@localhost \
    --to=andrew@mbmnz.co.nz \
    --cc=9fans@cse.psu.edu \
    /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 NNTP newsgroup(s).