copying the files in vi editor

Hi,

For a particular file i used Vi editor to view the content and i have to copy the same ,

But in the files if have 1000 lines and i have to copy the file contents from 700th to 900th lines

But while copying i'm dragging the mouse from top to bottom but i supposed to copy the lines page by page

Could you please help with any short cuts to copy the files in VI editor

It will great full for me

Thanks for understanding

Regards
Thelak

Like:

: 700,900 w newfile

?

Do you want to copy these lines to a new file? Or to the clipboard of your WM? Does the solution have to be vi-specific, or would a command line do?

:700,900w new_file

Hi,

I dont have enough permission to create a new files in the server

Actually my question

i have to copy multiple pages of long file inside the vi editor in single shot!

---------- Post updated at 07:26 PM ---------- Previous update was at 07:24 PM ----------

its vi specific ,i don't want to copy the lines to a new file

I have to copy those lines from my log file to append to my mail

What program are you using to connect to the server? Or do you want to send the mail directly from the server?

we are using putty to connect the server,no i don't want to send mail from the server

The log files will generate every minute in our server ,it contains lots of contents
like error,warning,alert
we have to copy the alert part from the log file and paste it in our mail for analysis,it will be with huge content and it cross more than 5 pages so we are copying the lines page by page

Regards
Thelak

If you can't use mail or other tools to send a file from a server or use ssh (or other tools) to copy it to your local system (why?) the only way is to copy and paste. You can use "tail -n+700 YOURLOG| head -n200" and copy the content from the putty window.
You execute vi on the server and all buffers are on this server. You can't extract them in any way to your system IMO.

Ok, so your problem isn't vi specific, because your problem would be the same no matter what editor you're using.

And PuTTY does not offer any other way to copy text to the clipboard other than selecting with the mouse. Your best bet would be a sed command to extract the required lines, and pipe that into a mail sent to yourself if possible.