• Log in or sign up for an account here: https://www.sythe.org/login

Removing duplicate words from a text file?

Random Man

Apprentice
Joined
Jul 5, 2009
Sythe Gold
4
Messages
722
Two Factor Authentication User
I have a 2.8 gb text file, and I need all the duplicate words removed...
 
Valentine's Singing Competition Winner
Sythe Awards 2015 Winner
Sythe Awards 2016 Winner
Sythe Awards 2020 Winner
Member of the Month Winner
MushyMuncher
Gohan has AIDS
Extreme Homosex
World War 3
I'm LAAAAAAAME
Discord Verified
Off Topic Participant
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.
 
Two Factor Authentication User
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.

Alright. Thanks. :)
 
Runescape Gamblingrunescape gambling
Back
Top