I've got a .txt such as (tabs separated):
1 2345
1 2346
1 2347
1 2348
1 2412
1 2413
1 2414
The first four consecutive lines contain the consecutive integer values 2345 through 2348. Similarly, the last three lines contain the consecutive values 2412 through 2414. I want to group them such that the minimum and maximum of these sets of consecutive values appear on a single line as shown below:
1 2345 2348
1 2412 2414
Any idea?