1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[Ask] Find and Replace with notepad++

Discussion in 'General Chat' started by aandamar, Sep 14, 2012.

  1. #1
    hello all,
    I'm confused to find and replace using notepad++
    the file.txt content is like this:
    
    [any text here] word 1
    [any word here] word 2
    [text here] word 3
    [texts here] word 4
    [problem here] word 5
    and then
    
    Code (markup):
    I want to remove the text between "[" and "]" sign and also remove them so it will looks like this:
    
    word 1
    word 2
    word 3
    word 4
    word 5
    
    Code (markup):
    thanks
     
    aandamar, Sep 14, 2012 IP
  2. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    405
    Best Answers:
    21
    Trophy Points:
    295
    #2
    Not entirely sure I follow that but you want to "find" what it is you have to remove and replace it with nothing.

    Nigel
     
    Nigel Lew, Sep 14, 2012 IP
  3. aandamar

    aandamar Well-Known Member

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    Digital Goods:
    3
    #3
    yes mate, I want to find every text inside [ and ] sign and replace it with nothing

    thanks
     
    aandamar, Sep 14, 2012 IP
  4. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    405
    Best Answers:
    21
    Trophy Points:
    295
    #4
    Did that help? Just leave the replace field empty.

    Nigel
     
    Nigel Lew, Sep 14, 2012 IP
  5. aandamar

    aandamar Well-Known Member

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    Digital Goods:
    3
    #5
    each text inside [ and ] has different text and it about 2k+ line :D
    so how to remove them at once using regex?

    thanks
     
    aandamar, Sep 14, 2012 IP
  6. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    405
    Best Answers:
    21
    Trophy Points:
    295
    #6
    ahh I see, I would ask this in the programming forum. That sort of php is beyond the scope of my skillset. A quick bit of google fu shows me that is doable though.

    I would actually ask this here http://stackoverflow.com/

    I don't quite know how to do this so its interesting now. I will poke around a sec and see if I can sort it out.

    Nigel
     
    Nigel Lew, Sep 14, 2012 IP
  7. attacante10

    attacante10 Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    1. Open Notepad++
    2. Ctrl + F
    3. Choose "Replace" Tab
    4. "Find what" --> fill with word that you want to replace , in you case then [
    5. "Replace" --> backspace
    6. Click Replace / Replace all
     
    attacante10, Sep 14, 2012 IP
  8. vaza

    vaza Member

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #8
    @aandamar, you have got pm.
     
    vaza, Feb 5, 2013 IP