copying the files in vi editor


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting copying the files in vi editor
# 1  
Old 07-28-2011
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
# 2  
Old 07-28-2011
Like:
Code:
: 700,900 w newfile

?
# 3  
Old 07-28-2011
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?
# 4  
Old 07-28-2011
Code:
:700,900w new_file

# 5  
Old 07-28-2011
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
# 6  
Old 07-28-2011
What program are you using to connect to the server? Or do you want to send the mail directly from the server?
# 7  
Old 07-28-2011
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying files

I'm trying to do this exact same thing, so far I have created this to move files i've named my script CP.sh #!/bin/bash cd /root/my-documents/NewDir/ for f in *.doc do cp -v $f root/my-documents/NewDir $f{%.doc} done When i go to run this in the console i type, bin/sh/ CP.sh but it... (7 Replies)
Discussion started by: MKTM_93_SIMP
7 Replies

2. Shell Programming and Scripting

Copying files

All, I need to grab and rename common files from several unique directory structures. For example, the directory structures looks like: /unique_dir/common/common/common/person_name_dir/common_file.txt There are over 90,000 of these text files that I'd like to put in a single directory as... (5 Replies)
Discussion started by: hburnswell
5 Replies

3. Shell Programming and Scripting

Files copying - [ Listed files alone. ] - Shell script

Hi All, I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files. To Do From Directory : /myproject/MainDir To Directory : /myproject/data List of files need to copy is in the file: /myproject/filesList.txt ... (4 Replies)
Discussion started by: linuxadmin
4 Replies

4. Shell Programming and Scripting

Copying Files

Hi All, I'm trying to list some files from my log directory and files are like this log.20110302_20.gz log.20110302_21.gz log.20110302_22.gz log.20110302_23.gz log.20110303_00.gz log.20110303_01.gz log.20110303_02.gz ............ log.20110311_22.gz log.20110311_23.gz... (2 Replies)
Discussion started by: thelakbe
2 Replies

5. Shell Programming and Scripting

Copying a line from one file to other using vi editor

Hi Guys, the command ":yy" copies the line but it can be pasted in the same file. How can it be done if I want to copy it in other file. (2 Replies)
Discussion started by: ajincoep
2 Replies

6. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

7. UNIX for Dummies Questions & Answers

Files search in vi editor

Hi All, Apologise if I am in the wrong forum, I am trying to view all files one by one in the vi editor that contain a pattern. This command work but not sure where to pipe it to use vi editor find . -name "pattern" -print | xargs -ltr tnx in advance (1 Reply)
Discussion started by: lingosa
1 Replies

8. Solaris

Copying Files

Hi, I understand that to copy files across server, the feasible way will be using scp command. Am I right? What if the two servers are not connected to a network? If by using a cross cable to link up both the server, what will be the best (fastest) way to copy files across? scp as well? ... (3 Replies)
Discussion started by: user50210
3 Replies

9. Solaris

Copying Files and

I am new user to solaris and installed solaris operating system on full Harddisk 120Gb. I am unable to copy music files to desktop and /home directory. One thing happened while registering is- i entered login-root and its password. The message prompted your system is crashed. Is it because of... (1 Reply)
Discussion started by: patilmukundraj
1 Replies

10. UNIX for Dummies Questions & Answers

Copying files

I like to know the command structure of copying files/directories from a unix box using telnet session to a windows box. (4 Replies)
Discussion started by: alpheusm
4 Replies
Login or Register to Ask a Question