Need help in Python and AWK: Printing least difference value between consecutive rows values, if column1 value is same Being a biologist, not able to do it. Your help is highly appreciated.
Input File: <tab delimited file> Chr1 A 10 Chr1 B 13 Chr1 C 12 Chr2 D 12 Chr2 E 14 Chr2 F 11
Description: In column 1, chr1 == chr1; so A-B, A-C, and B-C. Further, Chr2==Chr2 so same iteration will be followed.
Output File 1: <tab delimited file> A B 3 A C 2 B C 1 D E 2 D F 1 E F 3