Friday, May 20, 2005

VI tips - Copying from file to file

Here is how to copy the required number of lines from one file to another in VI editor. First use the following key combinations in the source file.

Press ESCAPE
Press Shift "(Shift double quotes)
Press a
Press the number of lines you want to copy
press yy
Now press " : " (COLON) to get the vi prompt.
Hit e "Destination file name"

Once you enter the Destination file go to the line where you want the lines copied to be inserted.

Press ESCAPE.
Press SHIFT "(Double quotes).
Press a.
Press p.

The lines get copied.

Labels:

0 Comments:

Post a Comment

<< Home

JUST FOR KICKS