The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-26-2008
Registered User
 

Join Date: Nov 2007
Posts: 13
help in vi

Hi,

I have a file called a.txt with around 200 lines which is a big file. I have another file called b.txt with around 50 lines. I want to merge both the files. How do we do it using vi?

Thanks.
Reply With Quote
Forum Sponsor
  #2  
Old 05-26-2008
Registered User
 

Join Date: Dec 2004
Location: New Jersey
Posts: 25
From within a.txt, move the cursor to the end of the file, enter "!!cat b.txt" (without the qoutes) and it should append the file b.txt to your file. You can then save as a.txt or another name.
Reply With Quote
  #3  
Old 05-26-2008
Registered User
 

Join Date: Nov 2007
Posts: 13
Thank you , that works.
Reply With Quote
  #4  
Old 05-26-2008
Registered User
 

Join Date: Jan 2008
Posts: 18
I usually just use ":r b.txt" while editing a.txt.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0