开发者

Edit form of notepad++ "find all in current document" window [closed]

开发者 https://www.devze.com 2023-02-22 16:52 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

Every morning at work I have to do the following: Look for entries in a simple text file that contain a specified substring, then copy those entries in a .doc template which I then have to fax to a 开发者_如何学Pythonclient. The problem is that notepad++, the program with which i open those files, has an otherwise very convenient feature for this (find all in current document), alas, it also adds the "line XYZ::" information at the start of every entry, which I then have to erase manually from the .doc template. Even though this has yet to happen, nothing prohibits those entries from reaching the hundreds, and then I will be stuck for hours and hours just hitting "backspace", "shift" and the arrow keys. Unacceptable.

Wordpad, on the other hand, does not have a massive "find" option akin to notepad++'s "find all in current document". Notepad doesn't have this either and MS Word thinks it is prudent to format search results in boxes, making it impossible for me to select them all, copy and paste them.

Is there any way to customize the output of "find all in current document" in order for the "line XYZ::" message to not appear? Mind you, I would look for a faster solution using a script, but I come from Linux, and only know how to accomplish basic bash/awk tasks.

Thank you for your time and interest.


Before pasting the search results into the word doc, you could do a "Find and Replace" using regex matching with this pattern;

\s+Line \d+:\s+

Just replace matches with an empty string - that will remove the line number prefixes from every line.


What you could do is to copy / paste the search results into a new Notepad++ document. Then you do a search and replace with regular expressions. You search for something like: \s*Line \d+:\s and replace with nothing. Don't forget to check the regular expression option.


There is a manual approach which i used to do before learning about regex, and that is in notepad++ you can do column select by leaving your cursor at the beginning of the document, scroll to the end of the document, hold Alt+Shift while you click on the column position you'd like to eliminate.

You'll be able to select all the line number prefixes this way, after which you just press delete.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号