def print_data(lines, iline, word, msg, nlines=20):
    """prints the last N lines"""
    msg = 'word=%r\n%s\n' % (word, msg)
    iline_start = iline - nlines
    iline_start = max(iline_start, 0)
    for iiline in range(iline_start, iline):
        msg += lines[iiline]
    return msg
