I have a series of string values that are generally a contiguous list of integers in a format of "1,2,3,4,5," -- although sometimes there can be contiguous ranges mixed with non-contiguous entries, such as "0,1,2,3,10,13,20,21,22,".
What I'm hoping to do is convert them to a range notation. So
I've implemented fixes in both perl and Crystal Reports formulas. Googling hasn't seemed to produce much help, but maybe I'm searching for the wrong thing. I was hoping someone might be able to point me in the right direction so I could implement this with a user defined function. Thanks!
What I'm hoping to do is convert them to a range notation. So
Code:
"1,2,3,4,5," becomes "1-5" and
"0,1,2,3,10,13,20,21,22," becomes "0-3,10,13,20-22"
I've implemented fixes in both perl and Crystal Reports formulas. Googling hasn't seemed to produce much help, but maybe I'm searching for the wrong thing. I was hoping someone might be able to point me in the right direction so I could implement this with a user defined function. Thanks!