help in vi


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers help in vi
# 1  
Old 05-26-2008
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.
# 2  
Old 05-26-2008
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.
# 3  
Old 05-27-2008
Thank you , that works.
# 4  
Old 05-27-2008
I usually just use ":r b.txt" while editing a.txt.
 
Login or Register to Ask a Question

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