Code: Select all
use strict;
my %seen;
while (<>) {
$seen{$_}++;
}
print sort keys %seen;
Code: Select all
Begin Perl
my perl macro
End
Is there maybe a Nisus macro which does the same thing?
Code: Select all
use strict;
my %seen;
while (<>) {
$seen{$_}++;
}
print sort keys %seen;
Code: Select all
Begin Perl
my perl macro
End
Code: Select all
#Nisus Macro Block
#source front selection
#destination clipboard
#after execution
#Paste
#End Nisus Macro Block
my %seen;
while (<STDIN>) {
$seen{$_}++;
}
print sort keys %seen;
The simplest Nisus Writer Pro way would be...js wrote:Is there maybe a Nisus macro which does the same thing?
Code: Select all
Menu ':Edit:Sort Paragraphs:Ascending (A-Z)'
Replace All '(^.*\n)\1+', '\1', 'E-is'
That means that you saved it as a Nisus Macro (filename.nwm). If it were a Nisus Perl Macro (filename.pl), "Begin Perl ... End" should have yielded an error.js wrote:I found BTW that in the case of the Perl macro, even without using it with additional Nisus code, I had to add a Start Perl / End line to make it work.