Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: aopHi!
Looking for help with configuring filter and do output statment. Any help would be appreciated!
My input data has two columns (named group and number) and the data is sorted by group and number. Number field contains running numbering sequence that might also have some gaps in the sequence.
Example of the data:
group,number
A,1000
A,1001
A,1002
A,1008
B,5123
B,5124
B,5129
I would need an output like the following:
group,start,end
A,1000,1002
A,1008,1008
B,5123,5124
B,5129,5129
I would need to achieve the following things:
-Step1: Group the input data so that each continous sequence (without gaps) belonging to a same group would be one line in the output with fields indicating the first and last number in the continous sequence. When there is a gap a new line in the output would be created
-Step2: I also have an additional requirement that the maximum length of one sequence in the output is 10 (including first and last) so for example if there is 11 numbers in a continous sequence then the the 11th number would be on another line in the output.