Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Perlify some awk'ing for SPAM graphing

by hacker (Priest)
on Jun 24, 2003 at 13:21 UTC ( #268489=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
       grep ^"From " SPAM-mbox |   \
       awk '{$1 = $2 = $6 = "";    \
       sort |                      \ 
       sed s/-$//g |               \
       uniq -c > spamstatfile
  2. or download this
          1 --Fri-Jun-13--2003
          1 --Fri-Jun-20--2003
          2 --Mon-Jun-9--2003
         10 --Tue-Jun-24--2003
          3 --Wed-Jun-11--2003
          1 --Wed-Jun-18--2003
  3. or download this
       set xdata time
       set timefmt "%b-%d-%Y"
       plot "spamstatfile" using 1:2
  4. or download this
    perl -lane '$h{"$F[3]-$F[4]-$F[6]"}++ 
         if /^From /; END {
            print $_, "\t", $h{$_} for keys %h
         }' SPAM  > spamdates

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://268489]
Approved by gellyfish
Front-paged by broquaint
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2015-11-25 05:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (670 votes), past polls