• Login
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 Aug 24, 2021, 7:45 AM

    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”

    A 1 Reply Last reply Aug 24, 2021, 12:01 PM Reply Quote 0
    • A
      Alan Kilborn @Александр Булатов
      last edited by Aug 24, 2021, 12:01 PM

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

      It’s currently not possible.

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

      А 1 Reply Last reply Aug 25, 2021, 11:53 AM Reply Quote 0
      • А
        Александр Булатов @Alan Kilborn
        last edited by Aug 25, 2021, 11:53 AM

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

        A 1 Reply Last reply Aug 25, 2021, 12:24 PM Reply Quote 1
        • A
          Alan Kilborn @Александр Булатов
          last edited by Aug 25, 2021, 12:24 PM

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

          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 Sep 1, 2021, 7:19 AM Reply Quote 1
          • А
            Александр Булатов @Alan Kilborn
            last edited by Sep 1, 2021, 7:19 AM

            @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.

            A 1 Reply Last reply Sep 1, 2021, 11:43 AM Reply Quote 0
            • A
              Alan Kilborn @Александр Булатов
              last edited by Sep 1, 2021, 11:43 AM

              @Александр-Булатов 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
              4 out of 6
              • First post
                4/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors