Export distances between trees to a file.