|Just another Perl shrine|
find a string and count of its occurence in a text fileby new@perl (Initiate)
|on Nov 14, 2007 at 04:30 UTC||Need Help??|
new@perl has asked for the
wisdom of the Perl Monks concerning the following question:
Am completely new at perl programming;
I am trying to count the occurence of a string "abc" in a flat file (data.txt) of following structure and return the count and the matching lines.
I am able to grep the matching lines for string "abc" using the below code, although i read that using grep is not advisable for huge files.
How can I get the count of matching lines?
Seeking your kind advise.