def linenumber_creator(txt):
    """
    >>> txt = '''This
    ... is
    ... a
    ... file'''
    >>> linenumber_creator(txt)
    [0, 4, 7, 9]

    >>> linenumber_creator('')
    []

    """
    linenumbers = []
    for idx, val in enumerate(txt):
        if val == '\n':
            linenumbers.append(idx)
    if linenumbers and linenumbers[0] != 0:
        linenumbers.insert(0, 0)
    return linenumbers
