Hi all,
I have started to learn perl and python but now I am completely stuck in this problem, thus I seek your help.
I have seven files with different number ranges. I want to compare their ranges and detect the common range from them. Below I have shown an example with three files (file1.txt, file2.txt anf file3.txt). These files are like:
file1.txt:
68476204: 9-50, 55-75, 80-132
NC_23987: 2-22, 1001-1085
68473073: 1-8
68485121: 1-10, 20-55
file2.txt:
68485121: 15-45
45905121: 2-98, 201-255
68476204: 8-30, 57-77, 88-180
NC_23987: 1-18, 1021-1055
68473073: 14-44
file3.txt:
68485121: 16-42
68476204: 8-22, 55-76, 81-118
From here, I want to generate two output. First one is the common ranges (common in all three) after matching left column id values. For the above input, my output1.txt will be:
68485121: 20-42
68476204: 9-22, 57-75, 88-118
The second output (output2.txt) contain only those ranges those are >=15. Here, the output2.txt will be:
68485121: 20-42
68476204: 57-75, 88-118
Any type of suggestion is appreciated.
Thanks
How you calculated
output1.txt
? Could you explain ?