This appears to work for the given test data.
test_data = open("./tmp/GL581_54270_28321_28325.dat", "rb").read()
all_groups = test_data.split("BASELINE")
print len(all_groups)
fp_out = open("./tmp/test_output", "wb")
for group in all_groups[1:]: ## removes empty, first split occurance
sep = group.partition("\n")
fp_out.write("BASELINE %s\n" % (sep[0]))
for x in range(12):
sep = sep[2].partition("\n")
fp_out.write("%s\n" % (sep[0]))
fp_out.write("-" * 50)
fp_out.write("\n")
fp_out.write(sep[2])
fp_out.write("\n")
fp_out.write("*"*50)
fp_out.write("\n\n")
fp_out.close()