"Find All" in Search Results window.

Usage tips, posted by users. No questions here please.

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

Post Reply

Would you like "Find All" output to go to Search Results window?

Yes please!
5
100%
Not bothered.
0
No votes
 
Total votes: 5

User avatar
Cloink
Posts: 81
Joined: Thu Sep 09, 2004 1:44 pm

"Find All" in Search Results window.

Post by Cloink »

This has been touched on before, but no poll.

I come from a mainframe/Roscoe (command line-based editor) background where the command "INCL" (include) is ubiquitous - which as you might guess, displays a list of all lines containing the string you specify.

If the Find dialogue had an option to send 'Find All' lines to the Search Results window, á là 'Find in Files', that would be much appreciated and close to my INCL command.

In the meantime, anyone wanting this ability with one click/keypress could achieve it with a Tool that calls something (e.g. a Perl script) to do it for you (will need to use the $Sel or $SelWord tool parameter macro) - only diff being that output would end up in the Tool/Command Output window instead. Then of course you can assign the Tool a shortcut key.

By the way, I've already got a perl tool that searches for keywords which will be easily adapted to take a parameter-word instead of using the keywords table. I've posted that before here:-
http://forums.textpad.com/viewtopic.php?t=7672

In fact, I'm going to do this for myself right now...

See here too:-
http://forums.textpad.com/viewtopic.php?t=7471
http://forums.textpad.com/viewtopic.php?t=4872
User avatar
Cloink
Posts: 81
Joined: Thu Sep 09, 2004 1:44 pm

Post by Cloink »

Here it is. Create a tool that execs your perl file with two params:-

Code: Select all

[path]\INCL.pl $File $SelWord
Note that "$SelWord" either selects the word around the cursor if there isn't already a selection made, else it uses the selection as is.

The INCL.pl file contains:-

Code: Select all

#!perl

my $f    = $ARGV[0];
my $srch = $ARGV[1];

my $i;

open IN, $f || die "Can't open $f" ;
while( <IN> ){
    if( /$srch/i ){ # case insensitive
        $i = index( $_, $srch );
        printf( "%5.5u,%3.3u %s", $., ++$i, $_ );
    }
}
close IN;

1;
Obviously you need Perl installed!
Post Reply