Hi,
I need to modify a number of very large tables. The tables contain recombination rates of each chromosome (ID) at specific positions.
The table has the structure: First column: ID; Second: Position; Third: Rate
Example input file
A 1 1.5
A 2 1.5
A 3 1.6
A 4 1.6
B 1 2.7
B 2 2.7
B 3 2.5
I would like to modify it into: First column: ID; Second: start position; Third: end position; Fourth: rate
Example output file
A 1 2 1.5
A 3 4 1.6
B 1 2 2.7
B 3 3 2.5
I usually edit my files using awk or sed, but I cannot figure out how to solve my problem. Help is much appreciated.