in reply to Re^2: Help! Stuck on methods to count file size.
in thread Help! Stuck on methods to count file size.

well, then you should add another element "name" into the hashes
and in the while-cycle if current max is found rewrite it,
exactly the same as the 'max' itself
  • Comment on Re^3: Help! Stuck on methods to count file size.

Replies are listed 'Best First'.
Re^4: Help! Stuck on methods to count file size.
by Anonymous Monk on Oct 11, 2013 at 23:29 UTC
    It works very well, very much appreciated you keeping helping me!!!
Re^4: Help! Stuck on methods to count file size.
by Anonymous Monk on Oct 12, 2013 at 02:48 UTC
    I should let you know this morning I got the result as following:
    Jan bytes 548725 files 355 max 87710 name filename01 Feb bytes 24031383 files 527 max 11223344 name filename03
    Thank you greatly!
Re^4: Help! Stuck on methods to count file size.
by Anonymous Monk on Oct 18, 2013 at 21:58 UTC
    Super Monker, please allow me to ask you for further advise of how can I count the uncompressed size of the files in each month in Julian order? As of if we know the ratio of the uncompressed file size is the file size * 2, it'll make the process much easier. Suppose add something in the code as below:
    (${$m[$day]}{'bytes'} += $value, *2${$m[$day]}{'files'})
    Or something as the likes...
      This part:
      ${$m$day}{'bytes'} += $value
      summing your bytes, and this part:
      ++${$m$day}{'files'}
      counting the amount of processed files.
      So if you wish to double your bytes you should do:
      ${$m$day}{'bytes'} += (2* $value)
      while(<DATA>){ ($day, $value, $name) = split / /; print "$day $value\n"; ${$m[$day]}{'max'} < $value ? (${$m[$day]}{'max'} = (2* $value), ${$m[$day]}{'bytes'} += (2* $value), ++${$m[$day]}{'files'}):( ${$m[$day]}{'bytes'} += (2* $value), ++${$m[$day]}{'files'}) ; }

      test it on some unsignificant data first.(always)

        Dear Master, it's a great pleasure to find your post on counting uncompressed and compressed files that I requested a month ago. I'll test it soon but I am sure it'll surprisingly generate the correct result. You are so respectable to all the learners, so much appreciate your creative contribution!