Community
    • 登入

    How can I see the "Replaced files" after search and replace?

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    11 貼文 3 Posters 789 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Robin CruiseR
      Robin Cruise
      最後由 編輯

      I made a simple search and replace. Said that “3 occurrences were replaced”, as you can see. Ok, but how can I see exactly those replaced files (their filenames) ?

      alt text

      Alan KilbornA 1 條回覆 最後回覆 回覆 引用 0
      • Alan KilbornA
        Alan Kilborn @Robin Cruise
        最後由 編輯

        @Robin-Cruise

        The simple answer is “you can’t”.

        The more complex answer is that if you had done a Find in Files first, you could use the results from that find to look at the rough areas where the Replace in Files had done its work.

        Another (complex) way is to save off all of the files that could be affected by a replacement to another location. Then, after the replace, use a directory(+file) compare utility to examine what changed.

        Be very careful with Replace in Files (that’s why it has a popup confirmation box).

        1 條回覆 最後回覆 回覆 引用 1
        • Robin CruiseR
          Robin Cruise
          最後由 Robin Cruise 編輯

          yes, but the option “Find in files” works only on a search, and yes it show me the result on “File result” debbugger. But not on the “Replace in files”. It should also show me the result (and filenames) on the replace I made, just as on a search.

          Alan KilbornA 1 條回覆 最後回覆 回覆 引用 0
          • Alan KilbornA
            Alan Kilborn @Robin Cruise
            最後由 Alan Kilborn 編輯

            @Robin-Cruise

            I don’t really understand your response.
            If you need that information, just to the Find in Files before the Replace in Files, like I had said. You can be sure that whatever was found in the first will be replaced in the second.
            Or maybe I’m missing something about what you’re saying.

            1 條回覆 最後回覆 回覆 引用 1
            • Robin CruiseR
              Robin Cruise
              最後由 Robin Cruise 編輯

              To be more specific, please compare this 2 print screens. First one shows me the result of the search (and the filename), the second one doesn’t show me the result of the files which I replaced (neither the filename).

              alt text


              alt text

              Alan KilbornA 1 條回覆 最後回覆 回覆 引用 0
              • Alan KilbornA
                Alan Kilborn @Robin Cruise
                最後由 編輯

                @Robin-Cruise

                As one example of why this cannot work this way, consider if your Replace with contains nothing, i.e., you are using a replacement to totally delete the matching text.

                In this case, there would be nothing to show.

                1 條回覆 最後回覆 回覆 引用 0
                • Robin CruiseR
                  Robin Cruise
                  最後由 Robin Cruise 編輯

                  so, for short, in the second case, notepad++ tell me the message: “Replace in Files 1 occurrence was replaced.”

                  It would have been nice to show me the name of the file that was changed, just like “Find All”. It is very important to check exactly the filenames, to be sure I didn’t miss something.

                  Please consider this for future improvements of notepad++.

                  PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
                  • PeterJonesP
                    PeterJones @Robin Cruise
                    最後由 編輯

                    @Robin-Cruise said in How can I see the "Replaced files" after search and replace?:

                    Please consider this for future improvements of notepad++.

                    You seem to be under the misunderstanding that this Forum is where the developers hang out and look for feature requests. Most of the regulars here are just fellow users of Notepad++, and cannot influence whether or not new features are added or bugs are fixed. The “Feature Request…” FAQ entry explains where to really go to make a true feature request that will be seen and tracked by the developers.

                    It would have been nice to show me the name of the file that was changed, just like “Find All”

                    Or, like @Alan-Kilborn has already told you twice, you can run Find All first (to give you the list of the found instances) followed by the Replace in Files which will actually do the replacement on those same matches.

                    Alan KilbornA 1 條回覆 最後回覆 回覆 引用 0
                    • Robin CruiseR
                      Robin Cruise
                      最後由 編輯

                      @PeterJones said in How can I see the "Replaced files" after search and replace?:

                      Or, like @Alan-Kilborn has already told you twice, you can run Find All first (to give you the list of the found instances) followed by the Replace in Files which will actually do the replacement on those same matches.

                      yes, but if I have 1000 files, and I want to check only 50 of them, it would take me longer to do both.

                      1 條回覆 最後回覆 回覆 引用 0
                      • Alan KilbornA
                        Alan Kilborn @PeterJones
                        最後由 Alan Kilborn 編輯

                        So what @PeterJones says is all true.

                        But, before you @Robin-Cruise , think “I’m going to go make a feature request for this now!” consider that when regulars such as @PeterJones and myself comment on what you are asking for, and kind of tell you it is a request that doesn’t make a great deal of sense, AND show you workarounds, don’t be at all surprised if your feature request gets ignored at best and declined at worst. Sorry, that’s kind of the reality of it.

                        Alan KilbornA 1 條回覆 最後回覆 回覆 引用 1
                        • Alan KilbornA
                          Alan Kilborn @Alan Kilborn
                          最後由 編輯

                          And, of course, the above advice was totally ignored. :-)

                          https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9275

                          1 條回覆 最後回覆 回覆 引用 0
                          • 第一個貼文
                            最後的貼文
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors