def combine_split_NM_lines(nm, data_lines):
    """
    combine split lines of data

        #N N [M]

    Indicates there are N columns of data. 
    If M is present, it indicates there 
    are M sets of data columns on each line.
    """
    if len(nm) == 1:
        return data_lines
    dl = []
    N, M = nm
    buf = ''
    for line in data_lines:
        if line.startswith('@A'):
            if len(buf) > 0:
                dl.append(buf)
            buf = []
            dl.append(line)
        else:
            if len(buf) > 0 and buf[-1] != ' ':
                buf += ' '
            buf += line
            if len(buf.split()) == N:
                dl.append(buf)
                buf = ''
    return dl
