I have data involving codes assigned to ranges in the form ofFrom   To     Code0      5      A5      10     A10     15     A15     20     B20     25     B25     30     A30     35     A35     40     A40     45     C45     50     C50     55     C55     60     B60     65     B65     70     BI want to condense this list to a list like thisFrom   To     Code0      15     A15     25     B25     40     A40     55     C55     70     Bwhere contiguous ranges (e.g., 0-5, 5-10, and 10-15) with the same code are merged.I am wondering if this could be done by sed or awk.
I want to condense a list of ranges (from-to)
text processing;sed;awk