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

how to remove a character at end of each line

Discussion in 'BlackHat Lounge' started by mic141414, Feb 9, 2011.

  1. mic141414

    mic141414 Regular Member

    Joined:
    Jul 3, 2008
    Messages:
    344
    Likes Received:
    117
    Location:
    USA
    Home Page:
    Hello

    I have the twitter account creator from erroronline14
    But each time i export the accounts there are in this format :
    user|pass|
    i need to get rid off the last | automatically

    I created 280 accounts and had to do it manually .. NEVER AGAIN !! :rolleyes: Too long !

    Does anyone know please a trick to remove the last part of each line automatically (in that case the last | of the line) ?

    Thanks in advance
     
  2. m3ownz

    m3ownz Regular Member

    Joined:
    Dec 12, 2009
    Messages:
    311
    Likes Received:
    135
    Open /copy paste into excel, all in 1st column
    Make a macro with this code:

    HTML:
    Sub striplast()
    Dim rng As Range
    
    For Each rng In Range("A1:A500")
        If Right(rng.Value, 1) = "|" Then
        rng.Value = Left(rng.Value, Len(rng.Value) - 1)
        End If
    
    Next rng
    
    End Sub
    
    Adjust the A1:A500 bit for however many lines you have, eg in your example A1:A280
     
    • Thanks Thanks x 2
  3. mic141414

    mic141414 Regular Member

    Joined:
    Jul 3, 2008
    Messages:
    344
    Likes Received:
    117
    Location:
    USA
    Home Page:
    thank you very much
    Where do i add a macro on excel please ?
    I looked but could not find it (yeah sorry not a excel expert )
    Thanks in advance
     
  4. m3ownz

    m3ownz Regular Member

    Joined:
    Dec 12, 2009
    Messages:
    311
    Likes Received:
    135
    In excel 2007:
    Click the [view] tab along the top.
    At the far right is the macro button. Click it, choose 'create macro' call it striplast and paste in the code in the vba editor that will appear.

    It will probably already have added the sub striplast() ... end sub bit, so just paste the stuff in between.
     
    • Thanks Thanks x 1
  5. mic141414

    mic141414 Regular Member

    Joined:
    Jul 3, 2008
    Messages:
    344
    Likes Received:
    117
    Location:
    USA
    Home Page:
    OK GOT IT to work
    Thanks a lot m3ownz that s gonna save me a lot of time
    Really appreciate it