in reply to string occurences
cat logfile|awk {'print $3'}|sort|uniq -c > counts.txt
This is the best approach, however, if your OS does not support such great tools, or you just want a Perl solution, this will work:
change the subscript accordingly, then run the program:$occurences{(split)[2]}++ while (<>); foreach $url (keys %occurences) { print "$occurences{$url}\t$url\n"; }
tigervamp<prompt> perl -w programname logfiles
|
|---|