On Tue, 20 Jun 2006 at 11:51am, Tim Chase wrote:

> > I have to correct some datafiles, and I need to paste a column
> > in the middle of my text file to replace the older column
> > which contain bad values.
> >
> > How can I do that ?
> [cut]
> > Hope I have been clear enough,
>
> Yes, that is fairly clear.  Vim supports block-wise pasting.
> However, last I checked (vim7 might expose this), you can only
> get a blockwise paste by yanking/deleting a blockwise selection.

FWIW, the setreg() function in 6.3 itself supported the "b" option to
set a register with "block" content. You can even set the width of the
block.

-- 
HTH,
Hari

>   Thus, you'd open a new window, paste your contents (which I
> assume are coming from outside Vim), and then use control+V to
> select the whole lot.  Once it has been selected, you can
> yank/delete it.  Then, flip back over to your document and
> navigate to the column in which you want to put the contents.
> Simply use p (or P depending on your cursor location relative to
> where you want the text) and it will put in the block of text
> vertically as you describe.  I don't think it will replace, but
> rather insert text at the location.  However, you can use a
> similar means (control+V, select, "d") to delete the unwanted
> text column.
>
> This does assume that your document(s) is/are truely column-wise,
> not tab-delimited or CSV columns.
>
> To learn more, you can read up on blockwise-visual selection at
>
>       :help blockwise-visual
>
> -tim
>
>
>
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to