Removing duplicate words from a text file?

Discussion in 'Technology' started by Random Man, Jan 25, 2013.

Removing duplicate words from a text file?
  1. Unread #1 - Jan 25, 2013 at 1:42 PM
  2. Random Man
    Joined:
    Jul 5, 2009
    Posts:
    722
    Referrals:
    1
    Sythe Gold:
    4
    Two Factor Authentication User

    Random Man Apprentice

    Removing duplicate words from a text file?

    I have a 2.8 gb text file, and I need all the duplicate words removed...
     
  3. Unread #2 - Jan 25, 2013 at 2:37 PM
  4. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    Removing duplicate words from a text file?

    Big text files: http://download.cnet.com/Large-Text-File-Viewer/3000-2379_4-90541.html

    As for removing duplicates, this code would do it

    Code:
    Dim arrLines() As String = Split(Textfile, vbCrLf)
    Dim lstLines As List(Of String) = arrLines.ToList()
    
    For i As Integer = 0 To Lines.Length - 1
    
        For j As Integer = 0 To Lines.Length - 1
    
            If lstLines(i) = lstLines(j) Then
                
                lstLines.RemoveAt(j)
    
            End If        
    
        Next
    
    Next
    You then just save the content of lstLines into a new textfile.
     
  5. Unread #3 - Jan 25, 2013 at 2:42 PM
  6. Random Man
    Joined:
    Jul 5, 2009
    Posts:
    722
    Referrals:
    1
    Sythe Gold:
    4
    Two Factor Authentication User

    Random Man Apprentice

    Removing duplicate words from a text file?

    Alright. Thanks. :)
     
< CentOS and Java | Linux and IOS >

Users viewing this thread
1 guest


 
 
Adblock breaks this site