in reply to Reaped: count total number of occurrence in all files
When I download your data files, I find a title and blank line at the start of each. I removed them. Your processing requires a blank line after every record. This includes the last record of every file. I inserted a blank line at the end of each file which did not have one. With these changes, your code created the hash correctly.
Your code does not extract the numeric field from the hash value. With the following change, your code produced the output that you expect.
# $tot += $val; $tot += ( split /:/, $val )[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: count total number of occurrence in all files
by Anonymous Monk on May 10, 2016 at 05:59 UTC | |
|
Re^2: count total number of occurrence in all files
by Anonymous Monk on May 10, 2016 at 07:35 UTC | |
by BillKSmith (Monsignor) on May 10, 2016 at 11:58 UTC |