Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to have some grep-like functionality in Notepad++.

In it simplest version, I would like to be able to copy all lines from the current buffer that contain the word foo to a new buffer. I can use the TextFX plugin to hide all lines without foo, but that doesn't do all that I want (it's lost on Alt - Tab, I can't copy only the matching lines, etc.).

share|improve this question

2 Answers 2

Ctrl+F --> goto Mark tab --> toggle Bookmark line --> Click Mark All

Select menu: Search --> Bookmark --> Copy Bookmarded Lines

share|improve this answer
3  
Nice, thanks. You can 'cut bookmarked lines' for a poor man's grep -v too. –  ARRG Jul 15 '13 at 15:02
    
In later versions, e.g. 5.4.5, there isn't any "Mark" tab. Instead, there is a checkbox, "Mark Line", in the "Find" tab. And "Copy Bookmarded Lines" is direcly in the "Search" menu. –  Peter Mortensen May 4 at 22:23

I was just looking into this same question. I am not sure if you're aware; in the Find dialog, you can Find All in Current Document which will pop up a window at the bottom showing the matching lines. Then you can copy that into a new document.

Unfortunately, it includes some extraneous information in the results (line number, etc.), but you can filter that out using column mode.

share|improve this answer
1  
The added line numbers might even be a feature :) –  Frank Meulenaar Apr 14 '12 at 7:37
1  
You might find this plugin useful code.google.com/p/searchplus –  Amarghosh Oct 5 '12 at 14:14
    
@Amarghosh Nice plugin, but lacks a bit of ergonomy (why buttons and no keyboard shortcuts ?). Nice catch :) –  Benj Apr 5 '13 at 11:58
    
@Benji Alt-Q will launch the plugin. Even though there are no shortcut keys within plugin window, basic tab navigation has been enabled. If there is enough interest in the plugin, I will try to add more features as I get some time. Thanks for the feedback :) –  Amarghosh Apr 6 '13 at 13:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.