Hi,
I have a doubt regarding perl hash data. I have a tab delimited as below:
file1.txt
My objective would be to count the anumber of AM and PM according to the bin number as below:
bin1 3AM 1PM
bin2 1AM 1PM
I am planning to collect the data in a hash as below: With a comma separating each vale.
I know how to collect the data into a hash as above. I am not able to post my preliminary code as I am not in office right now.
My doubt is after collecting the data into a hash as shown above, how do I count how many AMs and PMs are in each record?
Please let me know.
Regards
I have a doubt regarding perl hash data. I have a tab delimited as below:
file1.txt
Code:
name1 AM bin1 name2 AM bin1 name3 PM bin1 name4 AM bin2 name5 AM bin1 name6 PM bin2
bin1 3AM 1PM
bin2 1AM 1PM
I am planning to collect the data in a hash as below: With a comma separating each vale.
Code:
{key} {value}
bin1 AM,AM,PM,AM
bin2 AM,PM
My doubt is after collecting the data into a hash as shown above, how do I count how many AMs and PMs are in each record?
Please let me know.
Regards
Comment