Community
    • Login

    Format of search results

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 2 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Александр БулатовА
      Александр Булатов
      last edited by

      Currently a line of search results contains the line number ("Line 834: ") followed by a string found. Is it possible to add the file name to each line of search results? For example, it might look like

      (File1.txt) Line 834: “a string found No.1”
      (File1.txt) Line 838: “a string found No.2”

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Александр Булатов
        last edited by

        @Александр-Булатов

        It’s currently not possible.

        Is there something behind your need other than a purely visual effect?

        Александр БулатовА 1 Reply Last reply Reply Quote 0
        • Александр БулатовА
          Александр Булатов @Alan Kilborn
          last edited by

          @Alan-Kilborn I would like to copy the results to MS Excel for further treatment. I need a separate column with file names.

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Александр Булатов
            last edited by

            @Александр-Булатов

            For Excel, maybe I’d suggest a format like:

            "File1.txt",834,“a string found No.1”
            "File1.txt",838,“a string found No.2”
            

            My first thought was that replacement using regular expressions might help here, but looking at that it became a bit problematic.

            If you’d consider using the PythonScript plugin to achieve your goal, I’d be willing to write you a demo script that can do the basics of what you want.

            It’s been on my todo list to put together a demo of accessing the Search results panel data in a nice way, and this little problem of yours might be a nice thing to showcase it.

            Let me know what you think.

            Александр БулатовА 1 Reply Last reply Reply Quote 1
            • Александр БулатовА
              Александр Булатов @Alan Kilborn
              last edited by

              @Alan-Kilborn I an not familiar with Python, however, I can achieve the goal using the features of Microsoft Excel. But, you see, this is not a convenient way.

              In general, I like the current search panel of Notepad++ very much, that is why I would prefer an another option for it. The search result might look like

              (file path/filename.extension) line 834: “search result”

              with a single list of items (instead of a separate list for each file). It would be great if the presence of file path is configurable and the symbol after the line number is also configurable.

              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Alan KilbornA
                Alan Kilborn @Александр Булатов
                last edited by

                @Александр-Булатов said in Format of search results:

                I would prefer an another option for it.

                You are free to request that the Notepad++ developers make this output format configurable. I’d say the likelihood of it happening are close to zero, though.

                To make an official feature request, see the how-to here: https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors