The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
calculating sum of fields in a file dsravan Shell Programming and Scripting 4 01-03-2008 10:00 AM
how to get the columns name and fields from this file. rnallamothu Shell Programming and Scripting 15 06-13-2007 05:14 AM
Removing certain fields from a file sendhilmani123 Shell Programming and Scripting 1 05-01-2006 11:01 PM
Extarcting particular fields from a file sendhilmani123 Shell Programming and Scripting 2 04-26-2006 06:24 AM
Formatting fields of a file kolvi Shell Programming and Scripting 4 08-11-2005 03:21 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-13-2005
Registered User
 

Join Date: Sep 2005
Posts: 12
How to add fields in a file

Hi all!

I have two files containing one field each.
The fields consist of numbers separated in records e.g.

file1.dat

1657
2345
5678
5676
7978

7856
5686
5676
8990
.
.
.
etc

file2.dat
8764
6576
8785
5689
8678

6785
3597
9874
7856
.
.
.
. etc

I want to produce a third file wich contains fields from both files. The result should come out like:

file3.dat (file1.dat + file2.dat)

1657 8764
2345 6576
5678 8785
5676 5689
7978 8678

7856 6785
5686 3597
5676 9874
8990 7856
Reply With Quote
Forum Sponsor
  #2  
Old 10-13-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
paste file1.dat file2.dat
Reply With Quote
  #3  
Old 10-13-2005
Registered User
 

Join Date: Sep 2005
Posts: 12
huh, no sweat!

Incredible how easy something can turn out to be.
I feel embarrassed to have posted this thread, but posted is posted.....
Thanks alot Perderabo!

regards
bjorb
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 05:48 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