Home Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

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:
how to combine two files into one file using shell scrip Please use code tags when posting data and code samples!

thanks~

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

The Following User Says Thank You to cabrao For This Useful Post:
codecaine (12-06-2010)
# 3  
Old 12-06-2010
looks good, Thanks Cabrao~
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:32 PM
Help with shell scrip syntax errors Demas Homework & Coursework Questions 9 01-24-2017 03: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-06-2016 11:59 PM
Combine shell files cmccabe Shell Programming and Scripting 4 11-08-2014 11:51 AM
Combine shell files cmccabe Shell Programming and Scripting 2 11-03-2014 11:11 AM
Combine two files using shell script tsm2011 UNIX for Dummies Questions & Answers 4 08-10-2011 04:42 AM
Get file name in shell scrip loop: bad substitution soueric Solaris 4 05-02-2011 11:20 PM
How to convert shell scrip to binaric command raghunsi UNIX for Advanced & Expert Users 1 02-03-2010 01:27 AM
combine 3 excel files using shell. radhika Shell Programming and Scripting 11 05-06-2009 06:18 AM
Using cp command inside shell scrip yoavbe Shell Programming and Scripting 2 06-22-2006 09:57 AM


All times are GMT -4. The time now is 04:52 AM.

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