Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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
[1nickt]: If 1nickt is the some guy, that's not what he said.
[GotToBTru]: thepkd might not know about last hour of cb
[1nickt]: my $x = $aohoaoh->[0]->{' foo'}->[0]->{'bar' }; should work
[thepkd]: its not $aohoaoh->[0]. its $aohoaoh[0]->{'foo '}. Tried it. Its working. Thnaks
[thepkd]: Hey 1nickt sorry man. What
[GotToBTru]: a ref too far ;)
[thepkd]: Yes this is my first time in cb. Trying to work my way around.
[JohnCub]: "A ref too far" would make a good title for anyone's perl memoirs
[thepkd]: Anyways it works with $aohoaoh[0]->{'foo '}[0]->{'bar'}

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2016-12-06 13:41 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (105 votes). Check out past polls.