Hi Ray
[quoted text, click to view] > Is that what you wanted, or did you want to be able to say:
> c has 1 duplicate
> e has two duplicates
Yes this is what i want
I tried to use your code, although i had to add 'end if', it gave me a
a 'Subscript out of range' error at
[quoted text, click to view] >sCurVal = YourArray(i)
----------------------------------------------
this is my code for the array
----------------------------------------------
<%
Dim MyArray, sOutput
MyArray = rs.GetRows()
MyArray = arraysort(MyArray)
Dim iRowLoop
For iRowLoop = 0 to UBound(MyArray, 2)
sOutput = trim(left(MyArray(iColLoop, iRowLoop),10)) & "<br> "
Response.Write(sOutput)
Next
%>
----------------------------------------------
Actually the rows in the array is unique, the source is a text file dump of
terminal service processes, but i need to extract the user names of those
using a particular process twice, and how many times they have these
processes open. I cannot sort or search for duplicates in SQL, because the
first line contains a lot of spaces inbetween the headings which dosnt make
a qualified column name.
Hope you can help.
--
Michelle
[quoted text, click to view] "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:#CzQWeDWDHA.2352@TK2MSFTNGP12.phx.gbl...
> If you've already sorted your array alphabetically, you can do:
>
> Dim sCurVal, sLastVal, iDups
> iDups = 0
> For i = LBound(YourArray) To UBound(YourArray)
> sCurVal = YourArray(i)
> If sCurVal = sLastVal Then iDups = iDups + 1
> sLastVal = sCurVal
> Next
>
>
> This will just give you the total number of duplicate items, like, if your
> array is
>
> a,b,c,c,d,e,e,e,f,g
>
> iDups will return as 3, since there is one extra c and two extra e's.
>
> Is that what you wanted, or did you want to be able to say:
> c has 1 duplicate
> e has two duplicates
> etc.
>
> Ray at work
>
>
>
>
>
> "Michelle" <abc@hotmail.com> wrote in message
> news:3f2a7499$0$10354$afc38c87@news.optusnet.com.au...
> > hi,
> >
> > i have created an array from recordset containing user names
> > eg. (davidp, davidp, evenf, patricka, rebeccah)
> >
> > which i have sorted in alphabetical order, but i need to
> > identify duplicates in this array and the number of times it has
> > been duplicated.
> >
> > can someone help?
> >
> > --
> > Michelle
> >
> >
> >
>
>