*BSD News Article 26228


Return to BSD News archive

Xref: sserve comp.unix.bsd:13283 comp.unix.programmer:14424
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!cs.utexas.edu!news.tamu.edu!not-for-mail
From: m0v5533@tamsun.tamu.edu (Mahesh Vallampati)
Newsgroups: comp.unix.question,comp.unix.bsd,comp.unix.programmer
Subject: join command help
Date: 19 Jan 1994 02:00:37 -0600
Organization: Texas A&M University, College Station
Lines: 41
Message-ID: <2hipb5$9b8@tamsun.tamu.edu>
NNTP-Posting-Host: tamsun.tamu.edu

Dear Unix Gurus,
I have two files like this 
one.c     two.c
--------------------------------------------------------------------------------
1:1:1   | 1:1:1
1:2:1   | 1:2:1
1:3:1   | 1:3:1
2:1:1   | 2:1:1
2:2:1   | 2:2:1
2:3:1   | 2:3:1
3:1:1   | 3:1:1
3:2:1   | 3:2:1
3:3:1   | 3:3:1
  K       K
Now i want to creat a join on these two files.The join is on the columns 
indicated by the letter K.

This is the command used
join -j1 2 -j2 1 -o 1.1 2.2 1.3 2.3 -t: one.c two.c
According to join theory,i must get 27 rows but i am getting 15.

1:1:1:1
1:2:1:1
1:3:1:1
1:1:1:1
1:2:1:1
1:3:1:1
1:1:1:1
1:2:1:1
1:3:1:1
2:1:1:1
2:2:1:1
2:3:1:1
3:1:1:1
3:2:1:1
3:3:1:1

Any suggestions. Thanks
Please reply by mail
vallampa@eemips.tamu.edu
Mahesh vallampati