how to combine two files into one file using shell scrip

Tags
shell scripts

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 12-06-2010
how to combine two files into one file using shell scrip

eg.
file 1 has:

Code:
4  0 8628380 653253   0   0   0   0    0   0 
 2  0 8626407 655222   0   0   0   0    0   0 
 4  0 8633729 647892   0   0   0   0    0   0 
 5  0 8646253 635367   0   0   0   0    0   0

file 2 has:

Code:
4798 48717 11554 
5408 56487 14359 
6010 58415 15220 
5541 41044 12675


I want to make a file 3 like: ( appending each line of file2 in file1 )

Code:
4  0 8628380 653253   0   0   0   0    0   0 4798 48717 11554 
 2  0 8626407 655222   0   0   0   0    0   0 5408 56487 14359 
 4  0 8633729 647892   0   0   0   0    0   0 6010 58415 15220 
 5  0 8646253 635367   0   0   0   0    0   0 5541 41044 12675

any advice will be highly appreciated.
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

thanks~

Last edited by vgersh99; 12-06-2010 at 06:42 PM.. Reason: code tags, please!
# 2  
Old 12-06-2010
Code:
paste file1 file2

This User Gave Thanks to cabrao For This Post:
codecaine (12-06-2010)
# 3  
Old 12-06-2010
looks good, Thanks Cabrao~
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Korn shell Script to combine Two files in one gagan0119 Shell Programming and Scripting 3 04-10-2017 04:32 PM
Help with shell scrip syntax errors Demas Homework & Coursework Questions 9 01-24-2017 04:39 PM
Help with Shell Scrip in Masking particular columns in .csv file or .txt file using shell script Mahesh G Shell Programming and Scripting 5 11-07-2016 12:59 AM
Combine data out of 3 files into one new file MyMemberName Shell Programming and Scripting 5 05-22-2015 03:18 AM
Combine shell files cmccabe Shell Programming and Scripting 4 11-08-2014 12:51 PM
Combine shell files cmccabe Shell Programming and Scripting 2 11-03-2014 12:11 PM
Combine two files using shell script tsm2011 UNIX for Dummies Questions & Answers 4 08-10-2011 05:42 AM
Get file name in shell scrip loop: bad substitution soueric Solaris 4 05-03-2011 12:20 AM
get data from files combine them to a file gc_sw Shell Programming and Scripting 4 12-21-2010 09:58 AM
How to convert shell scrip to binaric command raghunsi UNIX for Advanced & Expert Users 1 02-03-2010 02:27 AM
combine 3 excel files using shell. radhika Shell Programming and Scripting 11 05-06-2009 07:18 AM
Combine file using shell script justbow Shell Programming and Scripting 1 02-10-2009 03:48 AM
combine text files into one file zzthejimzz UNIX for Dummies Questions & Answers 3 11-06-2008 02:24 AM
Using cp command inside shell scrip yoavbe Shell Programming and Scripting 2 06-22-2006 10:57 AM
Execute an Oracle stored procedure from a shell scrip mh53j_fe Shell Programming and Scripting 1 06-03-2005 04:17 PM
All times are GMT -4. The time now is 08:10 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?