astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- ASCII Tables (`astropy.io.ascii`) »
- FixedWidthSplitter

# FixedWidthSplitter

class astropy.io.ascii.FixedWidthSplitter

  Bases: `BaseSplitter`

  Split line based on fixed start and end positions for each `col` in `self.cols`.

  This class requires that the Header class will have defined `col.start` and `col.end` for each column. The reference to the `header.cols` gets put in the splitter object by the base Reader.read() function just in time for splitting data lines by a `data` object.

  Note that the `start` and `end` positions are defined in the pythonic style so line[start:end] is the desired substring for a column. This splitter class does not have a hook for `process_lines` since that is generally not useful for fixed-width input.

  Attributes Summary

  `bookend` |
  `delimiter` | one-character string used to separate fields
  `delimiter_pad` |

  Methods Summary

  `__call__`(lines) | Call self as a function.
  `join`(vals, widths) |

  Attributes Documentation

  bookend = False
  delimiter = '|'

    one-character string used to separate fields

  delimiter_pad = ''

  Methods Documentation

  __call__(lines)

    Call self as a function.

  join(vals, widths)