A simple R script to merge together lines that intersect with eachother.
Although other solutions to this problem supposedly exist, none are particularly simple and I couldn't get any to work! I've tested it on a GB river network with ~500,000 line segments. The resulting output ( ~22,000 merged lines) took about an hour to process.
NB Attributes are stripped so as not to provide misinformation in the output file.