Hi,

I have a .txt file that reads like this:

Name1 4-6, 72-109, 304-391
Name2 7-93, 101-110, 143-155, 167-500
..etc

I need to count the number of values across all the ranges for each name. So name1 would be:

4-6 = 3, 72-109 = 38, 304-391 =88

3 + 38 + 88 = 129 values in name1

I need to carry this out on 24,000 lines, anyone recomend a simple way using awk, C, Fortran or Python?

Thankyou