I want to delete a bunch of usernames from a huge text file, but don't know how...

xLoKuMx

Junior Member
Jun 24, 2009
188
146
Hi everyone,

I really need help!

I scraped a list of members from a site and want to delete all the staff members from it.

I have a text file with all members (about 8000), and I have a text file with all the staff members (about 100).

What is the best way to delete all the staff members from the huge member list?

I tried the search and replace function from a lot of programs, but they all can only replace one staff member at a time...
 
Do you want to delete the duplicates or just a bunch of names?

I would copy/paste into Excel. Sort the list in an order that would group them together, either ABC, 123, or Custom Sort.

Condition/Formatting > Highlight Cell Rules > Highlight Duplicates (if its for your duplicates)

If not, you can use the same formula for anything when it comes to slimming, organizing and getting rid of certain parts of the list.

If I'm far off (cause I am not sure if you are trying to remove duplicates or not) I know one thing can be changed and you should be fine to seek and remove whatever is needed.




*AlSO, Replace ALL in Excel is what you seem to be referring too. Just remove them from the txt file and return them when your done
 
Last edited:
You can use a vlookup in excel to compare the 2 sheets and then simply filter by the ones found in the main sheet and delete them. prob not easiest way but it takes less then a minute
 
Thanks to both of you, but I found a very handy solution!

Just paste all your content in a sheet and then run this macro:

Code:
Sub Delete_Duplicates()
Dim r As Long
Dim r2 As Long
Dim CurrentVal As String
Dim Unique As Boolean
    For r = 1 To Range("A65536").End(xlUp).Row
        CurrentVal = Range("A" & r).Value
        Unique = True
        For r2 = r + 1 To Range("A65536").End(xlUp).Row
            If Range("A" & r2).Value = CurrentVal Then
                Unique = False
                Range("A" & r2).EntireRow.Delete
                r2 = r2 - 1
            End If
        Next r2
        If Unique = False Then
            Range("A" & r).EntireRow.Delete
            r = r - 1
        End If
    Next r
End Sub
It deletes both duplicates. You don't have to sort or anything before... :)
 
Thanks to both of you, but I found a very handy solution!

Just paste all your content in a sheet and then run this macro:

Code:
Sub Delete_Duplicates()
Dim r As Long
Dim r2 As Long
Dim CurrentVal As String
Dim Unique As Boolean
    For r = 1 To Range("A65536").End(xlUp).Row
        CurrentVal = Range("A" & r).Value
        Unique = True
        For r2 = r + 1 To Range("A65536").End(xlUp).Row
            If Range("A" & r2).Value = CurrentVal Then
                Unique = False
                Range("A" & r2).EntireRow.Delete
                r2 = r2 - 1
            End If
        Next r2
        If Unique = False Then
            Range("A" & r).EntireRow.Delete
            r = r - 1
        End If
    Next r
End Sub
It deletes both duplicates. You don't have to sort or anything before... :)

Made simplicity simplified - Thanks!
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock