Menu

Find and Replace multine lines?

Mark
2006-11-27
2012-11-14
  • Mark

    Mark - 2006-11-27

    Hi all

    Just wondering if there are any plans to include the ability to find and replace multiple lines ...currently I have to switch to Editpad Pro when I need to do multiple line replacements and I'd much rather just use Notepad++. I find this an important function at times because I deal with a lot of HTML, so sometimes as an example I may need to replace:

    >> table id=sometable
    >> tr
    >> td

    with:

    >> table id=sometable
    >> tbody
    >> tr
    >> td

    so it'd be nice to run a find/replace on the above. Have I explained that ok? There's no way to currently do multiple line replacements is there?

    Cheers - keep up the great work. Your editor rules!
    Mark

     
    • fidvo

      fidvo - 2008-01-08

      You can also do it with the Simple Script plugin.

      (Disclaimer: I am the developer of the Simple Script plugin)

      The original poster's example could be done with a single line script:

      replace("table id=sometable\r\n","table id=sometable\r\ntbody\r\n")

      As far as running it on multiple files, I'm planning to add an option to run a script on all open tabs.  It's not in yet, but it will be there eventually.

      Running a script on a series of files on the hard drive without opening them is on the "Maybe" list.

       
    • Nobody/Anonymous

      Yeah! I think the same. Your editor rules. But could be better with a function that makes the Search & Replace experience better.
      I have to change EditPlus to make Search & Replace to many lines and to change tabs with new lines.
      Hope someboy read this and make it.
      Cheers from Perú
      Diego

       
      • Nobody/Anonymous

        Yeah this only appears to work on one file at a time. It would be extremely useful for web developers (for things like menus) if it could be done to multiple files at once, like the regular replace.

         
    • Rocky

      Rocky - 2007-05-07

      > Hope someboy read this and make it.

      Because Notepad++ is so nice someone (Chris Severance) has already done that. It is in the TextFx plugin that comes with Notepad++. In the menu go to TextFX > TextFX Quick > Find/Replace (or use Ctrl+R) and you have multiline Find/Replace with Regex support.

      Regards,
      Rocky

       
    • Nobody/Anonymous

      This only works on one file, would be great if it worked on all opened files

       
      • steakhacher

        steakhacher - 2007-05-12

        yes it is

         
    • Greg Bullock

      Greg Bullock - 2007-05-13

      You can also record a keystroke macro for that.

      First, search for, say, "table id=".  Then close the search window and record

      <End>
      <Enter>
      "tbody"
      <F3>

      where "tbody" represents the individual keystrokes, without the quotes.  If you prefer, you could paste the text from the clipboard and just record <Ctrl-V> instead.

      Play it back as many times as needed.

      Regards.