'Split ``line`` on the delimiter and determine column values and
column start and end positions.  This might include null columns with
zero length (e.g. for ``header row = "| col1 || col2 | col3 |"`` or
``header2_row = "----- ------- -----"``).  The null columns are
stripped out.  Returns the values between delimiters and the
corresponding start and end positions.
Parameters
line : str
Input line
Returns
vals : list
List of values.
starts : list
List of starting indices.
ends : list
List of ending indices.'

def get_fixedwidth_params(self, line):

    if ((self.col_starts is not None) and (self.col_ends is not None)):
        starts = list(self.col_starts)
        ends = [((x + 1) if (x is not None) else None) for x in self.col_ends]
        if (len(starts) != len(ends)):
            raise ValueError('Fixed    width    col_starts    and    col_ends    must    have    the    same    length')
        vals = [line[start:end].strip() for (start, end) in zip(starts, ends)]
    elif ((self.col_starts is None) and (self.col_ends is None)):
        vals = line.split(self.splitter.delimiter)
        starts = [0]
        ends = []
        for val in vals:
            if val:
                ends.append((starts[(-1)] + len(val)))
                starts.append((ends[(-1)] + 1))
            else:
                starts[(-1)] += 1
        starts = starts[:(-1)]
        vals = [x.strip() for x in vals if x]
        if ((len(vals) != len(starts)) or (len(vals) != len(ends))):
            raise InconsistentTableError('Error    parsing    fixed    width    header')
    else:
        if (self.col_starts is not None):
            starts = list(self.col_starts)
            ends = (starts[1:] + [None])
        else:
            ends = [(x + 1) for x in self.col_ends]
            starts = ([0] + ends[:(-1)])
        vals = [line[start:end].strip() for (start, end) in zip(starts, ends)]
    return (vals, starts, ends)
