columns = 1: chr 2: start 3:end 4: info(X) 5: info(X) 6:strand chr1 101 105 X X - chr1 102 108 X X - chr1 106 111 X X - chr1 112 113 X X - chr1 113 115 X X - chr2 114 118 X X - chr2 119 121 X X - chr2 120 123 X X - chr3 125 130 X X - chr3 131 132 X X - I need column 1 - 2 -3 - 6 I want to count the overlappes with 2 basepair overlappes for each cordinates in each chromosome and give ID number for those over laps together like in chr1 there are 4 cordinates and 3 of them have overlapped except the last cordinate : so I will need to first count those 3 overlappes and give them ID_1 then ID_2 will give to last cordinate in chr1 which is not have overlapped with others . then Counting is became zero for the chr2 and check inside the chr2 cordinates for overlap and give ID from ID_1 for chr2 again and counting and so on for all chromosomes and give the out put like this : TSSD_ID chr start end strand count ID_1 1 101 111 - 3 ID_2 1 112 113 - 1 ID_3 1 113 115 - 1 ID_1 2 114 118 - 1 ID_2 2 119 123 - 2 ID_1 3 125 132 - 1