Hello Monks!
Todays question is the following and code posted below. I am trying to match specific words from a file and a master list and post the count.
The above code works with no issues... However I have found some weird happenings...the code also gives a total word count in addition to giving how many names are in the list. What I want to do is MATCH the wordcnt with the FIELD in the flat file. I tried the adding the below code and it did nothing. Thanks for the help!my %count; my $wordcnt='Bob|Tom|Dave|Tom|Bob|Dave'; my @words = split(":"); # THIS IS PULLED FROM A FLAT FILE foreach my $word (@words){ if($word=~/($wordcnt)/io){ $count{$1}++; } }
if( ($word eq $wordcnt) && ($word[3] eq $wordcnt) )
In reply to Word Count and Match by PilotinControl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |