Re: Coincident values of string and numbers in 2 arrays.. [message #51869] |
Thu, 14 December 2006 13:34 |
greg michael
Messages: 163 Registered: January 2006
|
Senior Member |
|
|
Violeta wrote:
> Hello all:
> Maybe you can help me with this:
> I have 2 files, with columns for station id and depth. The first one
> has 2 columns like this
> 'IS02-34' 1
> 'IS02-34' 2
> IS02-34' 3
> 'IS02-35' 1
> 'IS02-35' 2
> 'IS02-35' 3
> 'IS02-37' 0
> 'IS02-37' 1
> 'IS02-37' 2
>
> And the second one has similar structure:
> 'IS02-35' 1
> 'IS02-35' 2
> 'IS02-35' 3
> 'IS02-37' 1
> 'IS02-37' 2
> 'IS02-37' 3
> 'IS02-39' 0
> 'IS02-39' 1
> 'IS02-39' 2
>
> Basically I want to find the lines on each file that both string
> (station id) and depth=1 are coincdent, and extract them.
> In this example, lines 4,8 from the first file, coincide with lines 1,4
> from the second.
> Any idea about how could I do this for 2 large files? I tried using
> 'where' but it doesn't like it....
> Thanks
Sounds like a set intersection you need...
http://www.dfanning.com/tips/set_operations.html
regards,
greg
|
|
|