def METHOD_NAME(filename, xaxcol=0, datacol=1, errorcol=2,
                text_reader='simple', format=None, **kwargs):
    """
    Attempt to read a 1D spectrum from a text file assuming wavelength as the
    first column, data as the second, and (optionally) error as the third.
    Reading can be done either with astropy.io.ascii or a 'simple' reader.  If
    you have an IPAC, CDS, or formally formatted table, you'll want to use
    astropy.io.ascii and specify a format.
    If you have a simply formatted file of the form, e.g.
    # name name
    # unit unit
    data data
    data data
    kwargs are passed to astropy.io.ascii.read
    """
    if text_reader in ('simple','readcol'):
        if text_reader == 'simple':
            data, error, XAxis, T = simple_txt(filename, xaxcol=xaxcol,
                                               datacol=datacol,
                                               errorcol=errorcol, **kwargs)
        elif text_reader == 'readcol':
            Tlist = readcol.readcol(filename, twod=False, **kwargs)
            XAxis = units.SpectroscopicAxis(Tlist[xaxcol])
            data = Tlist[datacol]
            error = Tlist[errorcol]
            T = dummy_class()
            T.data = dummy_class()
            T.data.dtype = dummy_class()
            T.columns = {}
            T.columns[T.data.dtype.names[xaxcol]] = dummy_class()
            T.columns[T.data.dtype.names[datacol]] = dummy_class()
    elif text_reader in ('ascii', 'astropy', 'asciitable'):
        T = ascii.read(filename, format=format, **kwargs)
        xarr = T.data[T.data.dtype.names[xaxcol]]
        data = T.data[T.data.dtype.names[datacol]]
        if len(T.columns) > errorcol:
            error = T.data[T.data.dtype.names[errorcol]]
        else:
            # assume uniform, zero error
            error = data*0
        if 'xunits' in T.keywords:
            xunits = T.keywords['xunits']
        else:
            xunits = 'unknown'
        XAxis = units.SpectroscopicAxis(xarr,xunits)
    # Need this in Spectrum class to correctly parse header
    T.xaxcol = xaxcol
    T.datacol = datacol
    return data, error, XAxis, T