Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > extracting unique strings from text file

Reply
Thread Tools

extracting unique strings from text file

 
 
Bubbles
Guest
Posts: n/a
 
      03-03-2004
Hello.

New to ASP.NET and struggling on this one.

I have a text file with a bunch of text in it. Throughout the file
words followed by a ":" will appear. I need to pull every such string
out and then display all unique values.

I am able to read the file in, but am having trouble getting regex to
work. What regex and setting should I use?

And how would you recommend I build a the unique list of array items
from the full list?


.... pressuming the text data is already in yy.text - the below code is
NOT working and may have bugs. I know the regexp is not working.

dim ccnt as integer
dim gg as arraylist
gg = new arraylist
Dim regexp as Regex = New Regex("^(w+):$", RegexOptions.IgnoreCase )
Dim objMatch as Match
For Each objMatch in regexp.Matches(yy.text)
gg.add(ltrim(objMatch.ToString()))
ccnt = ccnt + 1
Next
gg.sort
response.write(gg.count)
dim xxx as integer
FOR xxx = 0 TO gg.count-1
response.write(gg(xxx))
response.write("<br>")
next xxx

end sub
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting strings from a text file Andry Perl Misc 8 10-02-2008 10:06 PM
list question... unique values in all possible unique spots ToshiBoy Python 6 08-12-2008 05:01 AM
Extracting strings from text files poener Java 4 08-28-2006 06:45 PM
Strings, Strings and Damned Strings Ben C Programming 14 06-24-2006 05:09 AM
Extracting strings delimited by other strings Scott Bass Perl Misc 4 05-12-2005 09:06 PM



Advertisments