'Merging fps files requires merging the header manually.
We take the header from the first file.'

def merge(split_files, output_file):

    if (len(split_files) == 1):
        return data.Text.merge(split_files, output_file)
    if (not split_files):
        raise ValueError(('No    fps    files    given,    %r,    to    merge    into    %s' % (split_files, output_file)))
    out = open(output_file, 'w')
    first = True
    for filename in split_files:
        with open(filename) as handle:
            for line in handle:
                if line.startswith('#'):
                    if first:
                        out.write(line)
                else:
                    first = False
                    out.write(line)
    out.close()
