From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 3 Mar 2009 18:16:43 +0100 Message-ID: <5d375e920903030916s7b4572dfu51e4dab710412d0b@mail.gmail.com> From: Uriel To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] command repetition in sam/acme Topicbox-Message-UUID: acef1954-ead4-11e9-9d60-3106f5b1d025 Using a text editor to manipulate files with lines that are thousands of words long seems like a not very good idea to me. But all you need is two awk one liners to automate such task. Get desired w= ord: awk -v w=3D1000 -v ORS=3D' ' -v 'RS=3D ' 'NR=3D=3Dw { print } ' Replace it with a new value: awk -v w=3D1000 -v nw=3D'NewValue' -v ORS=3D' ' -v 'RS=3D ' 'NR=3D=3Dw { p= rint nw; next } { print } ' And so on for any other similar tasks. A script that prompts you for line and word number, prints it, and lets you enter a new value should be under a dozen lines of rc. uriel On Tue, Mar 3, 2009 at 5:31 PM, roger peppe wrote: > 2009/3/3 Russ Cox : >> s//\n/g >> .-0+1000 >> u >> >> that will show you what the 1000th word is, and then you >> can go back to it after the undo. =C2=A0It's not ideal, but you asked. > > watch out though... that actually takes you to the 1001st word! > >