extracting unique strings from text file

Discussion in 'ASP .Net' started by Bubbles, Mar 3, 2004.

  1. Bubbles

    Bubbles Guest


    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)
    ccnt = ccnt + 1
    dim xxx as integer
    FOR xxx = 0 TO gg.count-1
    next xxx

    end sub
    Bubbles, Mar 3, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.