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
in thread Counting devices types, device sizes and number of devices.
by perl514
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |