How to paste string yanked into an edit in cmd mode?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to paste string yanked into an edit in cmd mode?
# 1  
Old 03-20-2013
How to paste string yanked into an edit in cmd mode?

I have 2 files open in Vim at the same time.

I yank from one with

Code:
16yw

and get this

Code:
INSERT INTO ALIS_PART_MANU_PART_TAB (SEQUENCE_NO,PART_NO,MANU_NO,MANU_PART_NO,ROWVERSION) VALUES (

Now I go to the second file and type the command to add this to the beginning of every line

Code:
:.,$s/^/

but I can't get it to paste into the command?

I have tried p,P and combinations of this command.

What is the command?

I need:

Code:
:.,$s/^/INSERT INTO ALIS_PART_MANU_PART_TAB (SEQUENCE_NO,PART_NO,MANU_NO,MANU_PART_NO,ROWVERSION) VALUES (/g


thanks.
# 2  
Old 03-20-2013
Not sure about vim but in vi you would use a named buffer for such...
# 3  
Old 03-20-2013
Quote:
Originally Posted by djehresmann
Code:
:.,$s/^/

At that point, in vim, CTRL-R" (control-r followed by a double quote) will expand to whatever text is in the unnamed register (which would be the 16 words yanked if no other operations have written to that register).

Regards,
Alister
# 4  
Old 03-20-2013
Thank you!

I was trying named buffers but could not get it to work.

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep string in a file and paste next line in a specific way

Hello, I know there are many questions and replies regarding grep command. What I would like to do is a bit different. File A: hello world welcome to my page this is my test site how are you I am fine, thank you where have you been I was in hospital really hope you are fine now Thanks,... (10 Replies)
Discussion started by: baris35
10 Replies

2. Shell Programming and Scripting

Cut, replace and Paste a String from one file to another

I need to cut all the Strings in one file and Paste it in the another file in the Specific line by replacing the specific String. For Example Step 1: From the newfile.txt, i need to copy all the strings newfile.txt How are you, I am fine, How is your work newfle2.txt Hello david,... (2 Replies)
Discussion started by: Padmanabhan
2 Replies

3. UNIX for Dummies Questions & Answers

Paste a string after another string in file

Hello, how can I paste a string1 after a particular string2 in a file? (6 Replies)
Discussion started by: FelipeAd
6 Replies

4. Shell Programming and Scripting

Redirecting paste cmd

using paste -- sd " " via command line give sme desired output however when I use > it changes the format slightly. Anyone any ideas as to why this may happen Running SunOS alps 5.10 Generic_125100-05 sun4v sparc SUNW,Sun-Fire-T200 (14 Replies)
Discussion started by: rob171171
14 Replies

5. Shell Programming and Scripting

Unix cmd prompt how to get old cmd run?

Hi, I am using SunOS I want to serch my previous command from unix prompt (like on AIX we can search by ESC -k) how to get in SunOs urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies

6. Shell Programming and Scripting

Copy-paste string automatically

Hi i'm not really sure if it's possible or not in bash. Basically I want to convert a ssh key created with ssh-keygen to putty format. The problem is that puttygen doesn't have an option for supplying passphrase in batch mode so it must be entered manually. For sskey generated with ssh-keygen i use... (2 Replies)
Discussion started by: ktm
2 Replies

7. UNIX for Dummies Questions & Answers

Find, Replace & Edit a string?

Is this something SED would be used for or can AWK do it? I have a string that I would like to chop bits out of and re-arrange some of the rest. Basically I want to change this: <log4j:event logger="webserver" timestamp="1240110840109" time="Sun Apr 19 04:14:00 BST 2009" level="INFO"... (4 Replies)
Discussion started by: Sepia
4 Replies

8. Solaris

How can i edit /etc/vfstab in single user mode

Hi Experts /etc/vfstab is corrupted as while editing it i forgot to comment some of the line. how can i edit the file in single in user mod? also, i have some problem in CD drive , so i cant boot it from CD and do the changes. i tried mounding the root file system as rw, however no... (10 Replies)
Discussion started by: kumarmani
10 Replies

9. UNIX for Dummies Questions & Answers

cmd sequence to find & cut out a specific string

A developer of mine has this requirement - I couldn't tell her quickly how to do it with UNIX commands or a quick script so she's writing a quick program to do it - but that got my curiousity up and thought I'd ask here for advice. In a text file, there are some records (about half of them)... (4 Replies)
Discussion started by: LisaS
4 Replies

10. Programming

vector<string> with insert cmd

How do I correct this vector<string> insert. I am geeting segmintation dump. #include <algorithm> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <iostream> //#include <sstream> #include <string> #include <utility> #include <vector> using... (1 Reply)
Discussion started by: photon
1 Replies
Login or Register to Ask a Question