in reply to count the number of occurrences of a pattern in a file
$ perl -nle '$count++ while /XY[0-9]+/g; END {print $count}' inputfile
(not what your code does, but what you ask for in the subject line)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: count the number of occurrences of a pattern in a file
by johngg (Canon) on Apr 20, 2010 at 22:35 UTC |