The thing I wanna do is to check if 2nd and the 3rd columns are repeating (if not repeating, take 4th, 5th and the 6th columns as they are), print the first element in 5th and the last element in 6th column with their corresponding 4th column.
Example input looks like this:
Chr1 39584 39678 Chr1 39653 39654
Chr1 39584 39678 Chr1 39654 39655
Chr1 39584 39678 Chr1 39677 39678
Chr1 40023 40039 Chr1 40038 40039
Chr1 283979 283993 Chr1 283979 283980
Chr1 283979 283993 Chr1 283980 283981
Chr1 283979 283993 Chr1 283989 283990
Chr1 283979 283993 Chr1 283990 283991
Chr1 283979 283993 Chr1 283992 283993
Desired output looks like this:
Chr1 39653 39678
Chr1 40038 40039
Chr1 283979 283993
Thanks!