summarize bytes

Discussion in 'Perl' started by bastardx, Jun 7, 2005.

  1. bastardx

    bastardx Guest

    Hi
    I wonder if you can point me to some scripts because I don't know perl.
    I think that perl is best for what I want to do.
    I have special kind of logs which looks like following:
    ID - is client id
    Date - is server access date
    IN - bytes sent to server
    OUT - bytes received from server

    ID DATE IN OUT
    id12 2005-06-07 12 1091
    id16 2005-06-07 893 17881
    id12 2005-06-07 53 9912
    id34 2005-06-07 323 7211
    id34 2005-06-07 15 2381
    id34 2005-06-07 542 9771
    id16 2005-06-07 90 9912
    id16 2005-06-07 409 6712
    id12 2005-06-07 311 3443
    id34 2005-06-07 342 1123
    id12 2005-06-07 90 7455
    id34 2005-06-07 145 512
    id12 2005-06-07 88 1667

    I want to summarize IN and OUT bytes for particular ID per day
    Fg
    ID DATE TOTAL_IN TOTAL_OUT
    id12 2005-06-07 12314 8098794

    Can you help me?
    bastardx, Jun 7, 2005
    #1
    1. Advertising

  2. *** post for FREE via your newsreader at post.newsfeed.com ***

    >>>>> "bastardx" == bastardx <> writes:


    bastardx> Can you help me?

    Yes! Visit http://learn.perl.org, and read the stuff recommended there.

    And STOP POSTING TO COMP.LANG.PERL, which doesn't exist.

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


    -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
    http://www.newsfeed.com - The #1 Newsgroup Service in the World!
    -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
    Randal L. Schwartz, Jun 7, 2005
    #2
    1. Advertising

  3. bastardx

    bastardx Guest

    > bastardx> Can you help me?
    >
    > Yes! Visit http://learn.perl.org, and read the stuff recommended there.
    >
    > And STOP POSTING TO COMP.LANG.PERL, which doesn't exist.


    plonk
    bastardx, Jun 7, 2005
    #3
  4. bastardx

    Joe Smith Guest

    bastardx wrote:
    > id34 2005-06-07 323 7211
    > id34 2005-06-07 15 2381


    That's trivial to do using a hash or two in Perl.

    It's the sort of thing found as student exercises
    in early chapters of just about any Perl tutorial.

    Hint:
    $info{$id}{IN} += $in;
    $info{$id}{OUT} += $out;

    -Joe
    Followup-To has been set to comp.lang.perl.misc
    Joe Smith, Jun 7, 2005
    #4
  5. bastardx wrote:
    >> bastardx> Can you help me?
    >>
    >> Yes! Visit http://learn.perl.org, and read the stuff recommended
    >> there. And STOP POSTING TO COMP.LANG.PERL, which doesn't exist.

    >
    > plonk


    I wonder if you have any idea at all whom you just plonked.....
    Yes, it is *the* Randal L. Schwartz.

    Concidering your past contribution to the Perl community (you did
    contribute, didn't you?) I am quite certain that nobody will follow your
    your public plonk. Rather the other way round.

    jue
    Jürgen Exner, Jun 8, 2005
    #5
  6. bastardx

    bastardx Guest

    > I wonder if you have any idea at all whom you just plonked.....
    > Yes, it is *the* Randal L. Schwartz.

    I dont know him and never will, I hope :)
    anyway to be "the Randal L. Schwartz" is no excuse to be rude.
    excuse me "stupid" question if it realy was
    eos
    best regards
    bastardx, Jun 8, 2005
    #6
  7. *** post for FREE via your newsreader at post.newsfeed.com ***

    >>>>> "Jürgen" == Jürgen Exner <> writes:


    >> plonk


    Jürgen> I wonder if you have any idea at all whom you just plonked.....

    Besides, plonk'ing an *answerer* is useless. Plonk is a clue for all
    answer-givers to ignore future questions from a given clueless person.

    So, all you end up with is fewer (correct) answers. Your choice. :)

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


    -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
    http://www.newsfeed.com - The #1 Newsgroup Service in the World!
    -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
    Randal L. Schwartz, Jun 8, 2005
    #7
  8. bastardx

    thoomas Guest

    Don't be so sure --- I'm with bastardx on this one.
    thoomas, Jun 16, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Collins
    Replies:
    3
    Views:
    5,993
    Jason Collins
    Feb 18, 2004
  2. robin

    summarize text

    robin, May 29, 2006, in forum: Python
    Replies:
    4
    Views:
    1,876
    Lawrence D'Oliveiro
    Jun 5, 2006
  3. DeMarcus
    Replies:
    13
    Views:
    585
    BGB / cr88192
    Sep 14, 2010
  4. hhw
    Replies:
    0
    Views:
    90
  5. Jeff Dickens
    Replies:
    5
    Views:
    421
    Nathaniel Talbott
    Dec 1, 2003
Loading...

Share This Page