Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How create new column file from other files!!!

Status
Not open for further replies.

tonivm

Technical User
Mar 2, 2006
64
ES
Hi everybody:
Anybody knows how create a new column file from two different files?.

If we have a file1 that is as: ($nfn=field-file)

$1f1 $2f1 $3f1 $4f1 $5f1

0 1013 294 14 6E-5
0.1 1001.9 293.6 13.53 6E-5
0.2 990.8 293.2 13.06 6E-5
0.3 979.7 292.8 12.59 6E-5
0.4 968.6 292.4 12.12 6E-5

and file2 is as:

$1f2 $2f2 $3f2

0 286.69 14.0139
0.1 286.905 13.4659
0.2 287.121 12.918
0.3 287.336 12.37
0.4 287.552 11.8221

how can we create a new file as result is:

$1f2 $2f1 $3f2 $4f2 $5f1

0 1013 286.69 14.0139 6E-5
0.1 1001.9 286.905 13.4659 6E-5
0.2 990.8 287.121 12.918 6E-5
0.3 979.7 287.336 12.37 6E-5
0.4 968.6 287.552 11.8221 6E-5

thanks in advance and cheers to everybody. :)
 
you could always do:
paste file1 file2 | awk '{print $6, $2, $7, $8, $5}' > out

vidmo
 
Hi vidmo :
Thanks a lot that's I would like.
Cheers. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top