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!

second array?

Status
Not open for further replies.

vidmo

Technical User
Sep 18, 2006
14
GB
Hi, I have two files. E.g:
file a: 486 -1.47 38.1073
file b: 486 -1.97 34.7981 -3.35

and this is my script so far:
awk '
BEGIN {
while (getline < "file b") {
count[$1]=$2

}
}
{
if (count[$1])
print $1, $2*-1, $3, count[$1]*-1}' file a > out

I also want to print $4 of file b as well, but i get weird results ( i tried adding maxd[$2]=$4 after the count array)

how do i do this?

cheers
 
it's ok- got it

maxd[$1]=$4

cheers anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top