See the below code,
open(INP, "Test.txt") || die "can't open input file"; my %occuranceCounter; my %tidOccurance; while (<INP>) { if (/\-\-(TID\d+-\d+\@[\d\.]+ \d+)\-\-([^\n]+)\n/) { $tidOccurance{$1}=1; $occuranceCounter{$2}=$occuranceCounter{$2}+1; } } #print outputs foreach my $occurance (keys %occuranceCounter) { print "$occurance: ".$occuranceCounter{$occurance}."\n"; } print "Tid unique occurances is ".scalar(keys(%tidOccurance));
In reply to Re^2: Extraction n Airthmatic operation Fun on TEXTFILE
by arivu198314
in thread Extraction n Airthmatic operation Fun on TEXTFILE
by singhabsk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |