Unix/Linux Forum: URGENT : Comparing fields in two files for mixed o/p - Unix/Linux Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

URGENT : Comparing fields in two files for mixed o/p Rate Topic: -----

#1 User is offline   Hunter Icon

  • Newbie (User Level: 0/10)
  • Group: Members
  • Posts: 2
  • Joined: 31-May 09

Posted 03 June 2009 - 01:25 PM

Hi Experts,

I have a problem. Can you Help me?

I need a UNIX shell script for the below logic using AWK. The logic must lay on validating the first field. I am using -KSH.

I am in real hurry . I have to deliver ASAP :(

Table 1:

Cricket 16 28
Tennis 26 15
Wrestling 12 34

Table 2:

Cricket 25 26
Rugby 16 13
Wrestling 11 22

I need output as in table3.


Table 3:

Cricket 16 28 25 26
Rugby NA NA 16 13
Tennis 26 15 NA NA
Wrestling 12 34 11 22

If any questions plz ask me. Thankyou for your consideration.
0

#2 User is offline   Hunter Icon

  • Newbie (User Level: 0/10)
  • Group: Members
  • Posts: 2
  • Joined: 31-May 09

Posted 06 June 2009 - 07:45 PM

Guys/Gals,

I found "join" command will help.

join -a1 -a2 -e "NA" File1 File2

Thanks for viewing this post 44 times. :)
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Cambridge Plus :: Cambridgeshire Steam Rally :: PIC Boot Loader :: Classic Piston Rings
Unix Man Pages / Linux Man Pages :: HiFi Forum :: A14 Comments :: UNIX/Linux Forum Archives