Not found prompt on every file not containing searched string on Perl regexp replace all

Not found prompt on every file not containing searched string on Perl regexp replace all

10
Basic UserBasic User
10

    Jan 09, 2014#1

    Hi all

    I do a lot of search/replace against multiple files, and occasionally I need to parse items that may be in an unknown amount of files. When UltraEdit comes across a file that doesn't have my search item, it prompts a dialog that states "Search string X not found." - Is there any way to disable that prompt and have it keep going? I find myself button mashing "ok" an awful lot, really slows me down.

    Thanks!

    6,675585
    Grand MasterGrand Master
    6,675585

      Jan 10, 2014#2

      Please explain with more details how you run the search when getting this message prompt several times during one search?

      I use normally Find in Files with results written to output window and use Ctrl+Shift+Down/Up Arrow from within the document window to navigate through the found lines. With this method not prompt message is shown ever.

      Alternatively it is possible to run a Find within all open files. But I see no message prompt with the settings I have set at Advanced - Configuration - Search - Miscellaneous except no string can be found in any opened file. My search settings are:

      Code: Select all

      [ ] Show slim find dialog after start
      [ ] Continue find at End of File
      [x] Find dialog defaults to word under cursor
      [ ] Find Next/Prev finds selected text (not last searched for text)
      [x] Set focus to window when going to result of Lines Containing String
      [ ] Automatically bookmark current line on find
      [ ] Fill Search In Columns with selection points
          Special character used in find/replace strings (normally ^) ... ^
      Best regards from an UC/UE/UES for Windows user from Austria

      10
      Basic UserBasic User
      10

        Jan 10, 2014#3

        I just using the "replace text" button on the toolbar, usually running regex based search/replaces.

        If I have 10 files open, and my file pattern matches 5, I have to press OK on a window saying "string not found" five times for the non - matched files. This is what I want to turn off.

        I don't require/use the output window there. Just parsing simple text, so it's not required.

        6,675585
        Grand MasterGrand Master
        6,675585

          Jan 11, 2014#4

          So you switch manually from one opened file to another opened file and execute on every file the Replace command?

          It is not possible to deactivate the not found message as without the message a user does not know if the replace has done anything at all when the search string could not be found or if the Replace is still running (files in UltraEdit can be very, very large where a replace can take several seconds up to a minute).

          Of course you could simply select All open files in box Replace where and press button Replace All instead of manually running the replace manually on each opened file.

          All options available for finds/replaces are in the dialogs displayed and all configuration options for searches are listed in Advanced - Configuration - Search. There are no "secret" search configuration options or other possibilities to customize finds/replaces among using macros/scripts to automate file modifications.
          Best regards from an UC/UE/UES for Windows user from Austria

          10
          Basic UserBasic User
          10

            Jan 13, 2014#5

            Thanks Mofi

            I have ~20 files open at a time usually, and I run the replace all against them all at once - not manually on one at a time, as you are suggesting. So I replace against all open files at once, and the program scans each file one at a time, if nothing found - I have to click okay.

            The program didn't do this before, prior to some 19.x update I think. I do a lot of these operations, would be nice to see an option added back in to have this not happen, I end up mashing the "okay" button furiously now. I would love to have that functionality back as it was, or an option to have it that way, if I could.

            6,675585
            Grand MasterGrand Master
            6,675585

              Jan 14, 2014#6

              I still do not understand what you do exactly. Could you write step by step what you are doing?

              1. Press Ctrl+R to open Replace dialog.
              2. Select ....
              3. Press button ...

              I have stored all versions of UltraEdit in RAR archives down to UE v10.10c and therefore can find out easily if the behavior changed from one version to a later version.
              Best regards from an UC/UE/UES for Windows user from Austria

              10
              Basic UserBasic User
              10

                Jan 15, 2014#7

                Hi Mofi

                I appreciate your attention to this. Let me see if I can write up an exact tutorial on how to kick off the notification window here.

                Open UltraEdit, open a handful of files. For this example I opened seven new files.

                In three I type in "apples"
                In the other four, "oranges"

                Open up the replace dialogue, via icon or "ctrl R"

                Under find I put "^(.*)ples"
                Under replace I put "\1ricots"

                Under options I have match case, regular expressions:perl checked, replace all open files. Under advanced - regex engine is set to perl, replace all from top of file are both selected. That's it.

                When I hit replace all - it makes the appropriate replacement in the 3 files it can match my search term. For the other 4 open files, on each one I get a dialogue that stops the process and demands I click okay to continue, so I have to click okay four times in total. This did not used to happen. The dialogue just says "Search string '^(.*)ples' not found. Which is correct - I just don't care to ever see this dialogue. It's useless even, if you just mind the text in the Replace window that says "3 items replaced in 7 files".

                I hope that spells it out clearly enough, if not just ask.

                6,675585
                Grand MasterGrand Master
                6,675585

                  Jan 16, 2014#8

                  Thanks for the detailed instruction on how to reproduce this. I could reproduce it now and with the given details I remembered myself about a bug report I sent to IDM support and know therefore what is the cause: a bug in code of UltraEdit on using a Perl regular expression replace executed on all open files.

                  I have detected this bug with UE v19.10 and reported it on June 2013 by email to IDM support. It exists since UE v19.00 on which the Perl regular expression engine was updated. The issue does definitely not exist in UE v18.20 and previous versions. The problem does also not exist on running a non regular expression replace all or running an UltraEdit or Unix regular expression replace all on all open files. You can verify that with your steps by selecting the Unix regular expression engine as this simple replace can be done also with this legacy regex engine.

                  Because of this bug I can only suggest to report this issue to IDM support by email. The more users report an issue the higher becomes the priority for fixing it. Add to your email that Mofi reported this issue also on June, 21st 2013 by email with subject "Search string not found message although replaces are made".

                  In my report the steps describe this problem with 3 files opened and replaces are done in just 2 of the files whereby nothing found to replace in the active file. So I wrote about a wrongly displayed, single "string not found" message because nothing to replace in active file. Your step by step description is even better as it shows that the "string not found" message is displayed for every opened file not containing the search string which is more worse and definitely a pain with having many files opened not containing the searched string.
                  Best regards from an UC/UE/UES for Windows user from Austria

                  10
                  Basic UserBasic User
                  10

                    Jan 16, 2014#9

                    Hi Mofi

                    Thanks again for helping me chase this one down.

                    For my work I do a ton of the regex search/replaces, using the perl regexs - although I may try switching to unix style just for ease of use. This ends up being a daily pain in the butt! So if a bugfix can be made, it would really help me out.

                    I will toss IDM an email later on this. Good suggestion, and nice work figuring out which version the bug appeared in.