9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: roger peppe <rogpeppe@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] command repetition in sam/acme
Date: Tue,  3 Mar 2009 15:40:17 +0000	[thread overview]
Message-ID: <df49a7370903030740s38269e4bge3c3e0f5655ee5b2@mail.gmail.com> (raw)
In-Reply-To: <a560a5d00903030553g36312dax1187c51a0ebbc6c4@mail.gmail.com>

2009/3/3 Rudolf Sykora <rudolf.sykora@gmail.com>:
>> I would do it with awk myself, Much depends on what you want to
>> do to the 1000'th word on the line.
>
> Say I really want to get there, so that I can manually edit the place.

if i really had to do this (as a one-off), i'd probably do it in a
few stages:

copy & paste the line to a New blank window.
in the new window:
Edit ,x/[ 	]+/a/\n/
:1000

edit as desired
Edit ,x/\n/d

copy and paste back to the original window.

if you were going to do this a lot, you could easily make a little
script to tell you the offset of the 1000th word.

e.g.
sed 's/[ \t]+/&\n/' | sed 1000q | tr -d '\012' | wc -c

actually that doesn't work 'cos sed has line length issues.
so i'd probably do it in C - the program would take the line
as stdin and could print out address
of the word in acme-friendly notation, e.g. :-++#8499;+#6

it'd only be a few minutes to write.

another option would be to write a little script that used the
addr file repeatedly to find the nth match of a regexp.



  reply	other threads:[~2009-03-03 15:40 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03 12:07 Rudolf Sykora
2009-03-03 12:49 ` Steve Simon
2009-03-03 13:53   ` Rudolf Sykora
2009-03-03 15:40     ` roger peppe [this message]
2009-03-03 15:58       ` yy
2009-03-03 16:25         ` Rudolf Sykora
2009-03-03 15:58       ` Uriel
2009-03-03 15:59         ` Uriel
2009-03-03 14:15 ` John Stalker
2009-03-03 14:23   ` Rudolf Sykora
2009-03-03 16:09 ` Russ Cox
2009-03-03 16:31   ` roger peppe
2009-03-03 17:16     ` Uriel
2009-03-03 18:50       ` Rudolf Sykora
2009-03-03 16:39   ` Rudolf Sykora
2009-03-03 20:30   ` Arvindh Rajesh Tamilmani
2009-03-03 22:13     ` ron minnich
2009-03-03 23:19       ` J.R. Mauro
2009-03-03 23:37       ` Anthony Sorace
2009-03-04  0:31         ` Rob Pike
2009-03-04  0:44           ` J.R. Mauro
2009-03-04  0:56             ` Rob Pike
2009-03-04  1:51               ` J.R. Mauro
2009-03-04  2:15                 ` Rob Pike
2009-03-04  4:59                   ` J.R. Mauro
2009-03-04  9:41           ` Rudolf Sykora
2009-03-04  9:52             ` Rob Pike
2009-03-04 11:32               ` Rudolf Sykora
2009-03-04 13:31                 ` Uriel
2009-03-04 13:41                   ` Rudolf Sykora
2009-03-04 16:35                   ` John Stalker
2009-03-04 16:56                     ` ron minnich
2009-03-04 13:37             ` erik quanstrom
2009-03-04 14:14               ` Rudolf Sykora
2009-03-04 14:37                 ` erik quanstrom
2009-03-04 14:59                   ` Rudolf Sykora
2009-03-04 16:34                 ` Steve Simon
2009-03-04 17:03             ` Russ Cox

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=df49a7370903030740s38269e4bge3c3e0f5655ee5b2@mail.gmail.com \
    --to=rogpeppe@gmail.com \
    --cc=9fans@9fans.net \
    /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).