--- Sitha Nhok <[EMAIL PROTECTED]> wrote:
[snip]
> stored into a 2-D array.  Then I want to eliminate duplicates in a
> column or multiple columns.  I came from a C/C++ background, so the
only
> method I am really familiar with is traversing thru the column
comparing
> one element to the next element.  So, it is not very efficient.
[snip]

Ovid wrote: 
[snip]
Hi Sitha,

To answer this properly, we require an understanding of a couple of
things.  

1.  How do you define "duplicates"?  I assume that you mean, for a given
column, duplicates are a
data item that is repeated more than once.  For example:

 2 3 r s 8 1 a
 2 d u 8 4 1 h
 w w u a 4 1 9

In the first, third, and sixth columns, respectively, '2', 'u', and '1'
are duplicates.  Or do
you, perhaps, mean something else entirely?

2.  What is done when the data is eliminated?  Do elements get undefined
or shifted, perhaps?  For
example, in the diagram above, replacing the duplicates with spaces
gives us:

   3 r s 8   a
   d   8 4   h
 w w   a 4   9

Is that what you are looking for, or do things get shifted left or up,
or some combination of
that?

Cheers,
Ovid

[snip]


Hi Ovid:

Yes, you are correct about what I meant by duplicates.  However, what I
was looking to do with them is slightly different from what you
suggested.  If there is a duplicate, I want to remove not just that
column, but everything in that row.  And I would like to be able to
combine different columns together to match for duplicates. For example,

A B C D E F G  <== used for indexing
2 3 r s 8 1 a
2 d u 8 4 1 h
w w u a 4 1 a

Say I wanted to see if column A and B had duplicates, then I would
remove the entire row.  So the string that I would try to match up with
is "23".  None of the subsequent rows have a 2 in column A and a 3 in
column B, so there were no duplicates.  

However, if we did column F and G, the string would be "1a", and it
would find a duplicate in the last row; thus, removing the entire row.  

I hope that cleared up things.  I am not very good when it comes to
clarity, so I hope what I wrote was understandable.  Thanks again.


Sitha



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to