2009/3/3 roger peppe <rogpe...@gmail.com>:
> 2009/3/3 Rudolf Sykora <rudolf.syk...@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.
>

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,


-- 
- yiyus || JGL .

Reply via email to