'Find All' in the current document?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
conductor80
Posts: 2
Joined: Tue Nov 09, 2004 2:04 am

'Find All' in the current document?

Post by conductor80 »

Is there any command to "find all" matches in the current document?

One of the workarounds is to use the 'Find in files' and point to the current file.
The other workaround is to use the 'Mark all'. But you have to broswer the whole document to find all of matches. How to clean the marks?

None of the workarounds works well.

Any solutions?
Ed
Posts: 103
Joined: Tue Mar 04, 2003 9:09 am
Location: Devon, UK

Post by Ed »

How to clean the marks?
As you've probably found Ctrl-Shift-F2 or Search>"Clear all bookmarks".
Jens Hollmann
Posts: 26
Joined: Tue Mar 04, 2003 7:33 am

Post by Jens Hollmann »

I use fgrep for this purpose.

1) Get fgrep. For example from http://unxutils.sourceforge.net/

2) Set up a command-shell-tool in TextPad with parameter:

fgrep -n "$SelWord" $File

I have set a regular expression for jumping to a row:

^\([[:digit:]]+\):

Invoke the tool with something selected and you get all occurences of that in the output window.

HTH
conductor80
Posts: 2
Joined: Tue Nov 09, 2004 2:04 am

Post by conductor80 »

I created a tool menu item following your suggestion.
Is it possible to jump to the original document window by clicking one of the matches in the result window?

Thanks
Jens Hollmann
Posts: 26
Joined: Tue Mar 04, 2003 7:33 am

Post by Jens Hollmann »

Well, that's why I have the "^\([[:digit:]]+\):" part. I put that in the field for "regular expression for jumping..." and selected "1" at the drop down box for "line". That works fine. Double-clicking (or Return) on a line in the output-window jumps to the appropriate line in the text document.

Mind that sometimes you have to close the output window and start the tool again so the output window opens again so that certain changes for a tool take effect. So the safest way is to close the output window make your changes at the tool and invoke it again.

Another possibility is that yout fgrep produces another output. Mine looks like this:

Code: Select all

125:  test text
312:     this is a test text
Line number followed by the line that contains the search string.

HTH
Post Reply