Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am changing 5 components in AIX-UNIX using vi editor. The issue is I need to write the following change log in all the components that I change.
Log Userid Date Change Description
=== ===== ======== ================
101 bna 04/07/2009 Include PRT309 in SP
=== ===== ======== ================I entered these comments in one of the component. While editing the second file, is there a way to copy the above lines from the first file and paste them in the second file (or to 3rd, 4th or 5th file)?
Please help.
Thanks,
Balaji.

In vi, here are two ways to do what you want:
1) From the command mode, press : and then input the line numbers, w, and the file name. The following example copies lines 43 to 52 to a new file newfile:
:43,52w newfile
This appends to newfile:
:43,52w>> newfile
2) Another way is to use named buffers. From the cursor in command mode, this line copies 5 lines into named buffer a:
"a5yy
now, to copy that named buffer to another file, change to the newfile name using the e syntax:
:e newfile
To place the contents of buffer a below the cursor:
"ap
To go back to the original file:
:e#
You have to save any changes to newfile before you go back to the original file.

![]() |
Merge multiple files line...
|
installation of unix
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |