1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Black Hat SEO' started by xLoKuMx, Aug 30, 2010.

  1. xLoKuMx

    xLoKuMx Jr. VIP Jr. VIP Premium Member

    Joined:
    Jun 24, 2009
    Messages:
    173
    Likes Received:
    137
    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...
     
  2. Risky Business

    Risky Business Junior Member

    Joined:
    Apr 5, 2010
    Messages:
    120
    Likes Received:
    35
    Occupation:
    Awesomer...
    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
     
    • Thanks Thanks x 1
    Last edited: Aug 30, 2010
  3. blight12

    blight12 Regular Member

    Joined:
    Mar 5, 2009
    Messages:
    317
    Likes Received:
    66
    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 Thanks x 1
  4. xLoKuMx

    xLoKuMx Jr. VIP Jr. VIP Premium Member

    Joined:
    Jun 24, 2009
    Messages:
    173
    Likes Received:
    137
    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... :)
     
  5. Risky Business

    Risky Business Junior Member

    Joined:
    Apr 5, 2010
    Messages:
    120
    Likes Received:
    35
    Occupation:
    Awesomer...
    Made simplicity simplified - Thanks!