Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Find All" in Search Results window.

 
Post new topic   Reply to topic    Community Forum Index -> Tips
View previous topic :: View next topic  

Would you like "Find All" output to go to Search Results window?
Yes please!
100%
 100%  [ 5 ]
Not bothered.
0%
 0%  [ 0 ]
Total Votes : 5

Author Message
Cloink



Joined: 09 Sep 2004
Posts: 75

PostPosted: Sun Jan 13, 2008 11:12 am    Post subject: "Find All" in Search Results window. Reply with quote

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
Back to top
View user's profile Send private message
Cloink



Joined: 09 Sep 2004
Posts: 75

PostPosted: Tue Jan 22, 2008 8:43 pm    Post subject: Reply with quote

Here it is. Create a tool that execs your perl file with two params:-
Code:
[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:

#!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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Tips All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB