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

Need some help with Notepad++

Discussion in 'BlackHat Lounge' started by lostpassword, Jul 22, 2012.

  1. lostpassword

    lostpassword Junior Member

    Joined:
    Jul 19, 2012
    Messages:
    135
    Likes Received:
    199
    How do I delete everything after a character in each line?

    Example:

    The character is #

    232342#dafva
    sdbfdfs#sdbas
    SDbvasdv#dvbasdv
    asvasdv

    Gets turned into
    232342
    sdbfdfs
    SDbvasdv
    asvasdv
     
  2. facebookcpa

    facebookcpa BANNED BANNED

    Joined:
    Mar 3, 2012
    Messages:
    364
    Likes Received:
    98
    I am not sure but I think you have to replace #.* with nothing.Ctrl+F go to replace replace what with #.* replace to (here you leave it blank). Hope it works


    Sent from my iPad
     
    • Thanks Thanks x 1
  3. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    5,881
    Likes Received:
    7,122
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    Open your document in Notepad++

    Hit Ctrl+H for Search/Replace...
    Find what: #
    Replace with: \n_bhwizdash1t
    Set 'Search mode' to 'Extended'
    Hit 'Replace All'
    Hit 'Ok'
    Find what: ^.*_bhwizdash1t.*$
    Replace with: leave this blank
    Set 'Search mode' to 'Regular expression'
    Hit 'Replace All'
    Hit 'Ok'
    Close the Replace window
    Hit Ctrl+A to highlight the whole document
    Navigate to TextFX/TextFX Edit/Delete Blank Lines

    I'm sure their are more elegant ways to do this, but i'm not really good at reg ex :)
    or this lol, you just need to set the 'Search mode' to 'Regular expression' to make it work
     
    • Thanks Thanks x 2
    Last edited: Jul 22, 2012
  4. jb2008

    jb2008 Senior Member

    Joined:
    Jul 15, 2010
    Messages:
    1,158
    Likes Received:
    972
    Occupation:
    Scraping, Harvesting in the Corn Fields
    Location:
    On my VPS servers
    You naughty boy, are you comment spamming and you want to reduce URLs to original format?

    The .*$ regex replace is what I use :)
     
  5. lostpassword

    lostpassword Junior Member

    Joined:
    Jul 19, 2012
    Messages:
    135
    Likes Received:
    199
    Thanks, works wonder for me.
     
  6. Daisysiegal

    Daisysiegal BANNED BANNED

    Joined:
    Jan 22, 2012
    Messages:
    204
    Likes Received:
    16
    Kewl...thanks