I have a long BED-like file generated by bedtools intersect which has the following form:
chr1 1 100 chr1 1 10 0.9
chr1 1 100 chr1 11 20 0.5
chr1 1 100 chr1 21 30 0.92
....
chr1 1 100 chr1 91 100 0.3
chr1 101 200 chr1 101 110 0.3
....
chr1 101 200 chr1 191 200 0.1
chr1 201 451 chr1 201 210 0
....
etc
with multiple rows per region demarcated by the first three columns. I would like to split this into individual files per region (first three columns), so in this case, there'd be a file for chr1.1-100.bed, a file for chr1.101-200.bed, one for chr1.201-451.bed, each consisting of those lines with the region as the first three columns. Is there a quick way of doing this? I could knock something up in R (as I'm not too familiar with python), but there may be a faster way.