asdas


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users asdas
# 1  
Old 01-24-2011
Copy Paste

Hi, I would like to know how can i copy a portion of the file and paste it in another file as follows.
File 1:

Code:
    Hello, a greeting in the English language
    Hi (magazine), teen lifestyle publication
    Hi (kana), Japanese character
    Hi Records, in music, a Memphis soul and rockabilly label
    Hi, mobile phone brand of Dutch company KPN


File 2:

Code:
  12345
  45637678863
  21
  0997636t374387
  5464646

I need to copy the contents of file 2 and add it to file 1 to create a file as follows.

Code:
    Hello, a greeting in the English language 12345
    Hi (magazine), teen lifestyle publication  45637678863
    Hi (kana), Japanese character  21
    Hi Records, in music, a Memphis soul and rockabilly label  0997636t374387
    Hi, mobile phone brand of Dutch company KPN  5464646

I heard some how in VI editor we can copy and paste. But cant find out how!!


Thanks in Advance!!!!

Appu

Last edited by appualex; 01-24-2011 at 04:38 AM..
# 2  
Old 01-24-2011
Is this classroom stuff / homework?
What have you tried so far?
Why vi?

Try:
Code:
paste -d" " file1 file2

This User Gave Thanks to zaxxon For This Post:
# 3  
Old 01-25-2011
Describe a bit more in detail what you want to do, thanks.
This User Gave Thanks to GERMANICO For This Post:
# 4  
Old 01-26-2011
Thanks Guys, Smilie

Its not a classroom stuff. But I am trying to understand more about VI. I know it can be done using commands.

And ya, I need the result of the code given by zaxxon, but trying to do it in vi itself.

I tried using selecting using visual block and pasting it in the required place, but its giving me a TAB kinda space between the words pasted and the lines. Thinking on y its happening.

So thought i may be doing in the wrong way,so to get clarified.............
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question