unique values out of text area

J

jason

NEWBIE -

Hello. I've been able to do the following in other languages
(perl,jscript,etc.) but am a asp.net newbie and need some help.

I have this textbox that has a bunch of data in it. At the beginning
of almost every line I have some names followed by a ":" Many (about
3/4) of the names will be duplicates. I'd like to produce a unique
list of names (as they appear) and the count of unique names. So far I
can produce the list of names. In other languages I know how to build
an array that keys it's values by the value itself bucket and
resulting in only unique values. How would I accomplish this task in
VB-asp.net. Many Many thanks!



construct chatter list, remove dups
dim chatters as arraylist
chatters = new arraylist
dim sfor as string
sfor = "^(.+):"
Dim regexp2 as Regex = new Regex (sfor, RegexOptions.IgnoreCase or
RegexOptions.Multiline )
Dim objMatch as Match
For Each objMatch in regexp2.Matches(chat.text)
xcntt = xcntt + 1
Next
 
J

jason

NEWBIE -

Hello. I've been able to do the following in other languages
(perl,jscript,etc.) but am a asp.net newbie and need some help.

I have this textbox that has a bunch of data in it. At the beginning
of almost every line I have some names followed by a ":" Many (about
3/4) of the names will be duplicates. I'd like to produce a unique
list of names (as they appear) and the count of unique names. So far I
can produce the list of names. In other languages I know how to build
an array that keys it's values by the value itself bucket and
resulting in only unique values. How would I accomplish this task in
VB-asp.net. Many Many thanks!



construct chatter list, remove dups
dim chatters as arraylist
chatters = new arraylist
dim sfor as string
sfor = "^.*(W+):"
Dim regexp2 as Regex = new Regex (sfor, RegexOptions.IgnoreCase or
RegexOptions.Multiline )
Dim objMatch as Match
For Each objMatch in regexp2.Matches(chat.text)
xcntt = xcntt + 1
Next


ACTUALLY, THE ABOVE (MODIFIED) CODE IS NOT EVEN WORKING AT LOADING THE
ARRAY. THE REGEX IS NOT PULLING THE USERS FROM THE TEXT FIELD. HERE'S
A SAMPLE OF THE DATA (WHICH HAS HTML IN IT). I THINK MY PROBLEM IS
FINDING BEGINNING AND END OF LINE WITH LF OR CCTL..

<br><font color=red>sss: hello
<br><font color=brown>jessica: lol
<br><font color=red>sss: ddd
<br><font color=brown>jessica: who else is in here?
<br><font color=red>sss: ddd
<br><font color=brown>jessica: funny you say that
<br><font color=blue>robert: true

IN THE ABOVE THE DESIRED OUTPUT WOULD BE:

sss
jessica
robert

ARRAY COUNT=3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top