From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 3 Mar 2009 16:58:00 +0100 Message-ID: From: yy To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] command repetition in sam/acme Topicbox-Message-UUID: ac9c665a-ead4-11e9-9d60-3106f5b1d025 2009/3/3 roger peppe : > 2009/3/3 Rudolf Sykora : >>> 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/[ =A0 =A0 =A0 ]+/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. > Or you could also substitute the newline for whatever you want, so you don't have to copy/paste to another window, eg: Edit ,x/[\n]+/a/ENDOFLINE/ Edit ,x/[ ]+/a/\n/ Now you can go to the 1000 word with :/ENDOFLINE/+1000 and once you are done: Edit ,x/\n/d Edit ,x/ENDOFLINE/c/\n/ If you are sure you don't have blank fields you don't need ENDOFLINE and can use ^$ instead (don't forget to use the g command when you remove the new lines). A bit awkward, but I don't think there is (there should be?) a simple way to do such a weird task. hth, --=20 - yiyus || JGL .