On Dec 16, 2010, at 11:11 AM, Maurizio Gennaro wrote:
> THANK YOU!!! both to Matt and the other contributors.
You're welcome.
> The pearl script works fine and the constrain regarding the number
Small point, Perl is the name of the programming language. :)
> I only need to know how to assign the Unix Filter to a key combo in
> MAC, BBEdit manual doesn't help
> for this and the Menu->Preference->... custom keys does not directly
> allow for that and redirect to a Unix Folder palette key
> assignment...???
The way to do this is to go to the menu item Window->Palettes->Unix Filters
Then highlight the script name and hit set key.
BTW, I would update my script as follows based on John Delacour's script.
#!/usr/bin/perl
while ( chomp($line = <> )) {
@words = split( ', *', $line );
map { ( $words{$_} = $_ ) =~ s|^\d*||; } @words;
print join( ', ', sort {$words{$a} cmp $words{$b}} keys %words ) . "\n";
}
__END__
The changes will correctly account for spaces after the commas while allowing
words
to have embedded spaces and it will only be affected by numbers at the
beginning of the words.
It is also shorter albeit slightly less readable.
Have fun,
Matt
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>