Format of search results
-
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” -
It’s currently not possible.
Is there something behind your need other than a purely visual effect?
-
@Alan-Kilborn I would like to copy the results to MS Excel for further treatment. I need a separate column with file names.
-
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.
-
@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.
-
@Александр-Булатов 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