laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear perl514, sounds like you got a good concept of solving your problem. Please add your sourcecode to the questions if possible for better help. I'd walk through the lines using while (<$fh>) and split each line at \t which returns an array of each line's information. Understanding might be easier if you print out the split result array using join or Data::Dumper until your script is working. If all you need is this output, you may use a trick to avoid using references (which isn't that easy for Perl beginners) by using a hash and the full text part ("Total Number of $split_result[4] Devices of $split_result[7]MB") as the key. The "++" operator easily adds one for each device found matching that key. The conversion of MB's to other units may be done using a if/elsif/else block or a CPAN module like Format::Human::Bytes. In reply to Re: Counting devices types, device sizes and number of devices.
by Sewi
|
|