Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Programming (http://www.go4expert.com/forums/programming-forum/)
-   -   converting one series to another (http://www.go4expert.com/forums/converting-series-t27029/)

michaelgarton 28Oct2011 03:49

converting one series to another
 
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


All times are GMT +5.5. The time now is 14:52.