#!/bin/perl -w
use strict;
my $nbw=0;
foreach my $file (@ARGV)
{ open( XML, "pyx $file |") or die "cannot open file $file: $!";
while( <XML>)
{ next unless m/^-/; # skip markup
next if( m/^-\\n$/); # skip line returns
my @words= split; # get the words
$nbw+= @words; # get the number of words in the line
}
close XML;
}
print $nbw, " words\n";
In reply to XML word count by mirod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |