astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v0.3 »
- ASCII Tables (`astropy.io.ascii`) »
- DefaultSplitter

# DefaultSplitter

class `astropy.io.ascii.core.``DefaultSplitter`

  Bases: `astropy.io.ascii.core.BaseSplitter`

  Default class to split strings into columns using python csv. The class attributes are taken from the csv Dialect class.

  Typical usage:

      # lines = ..
      splitter = ascii.DefaultSplitter()
      for col_vals in splitter(lines):
          for col_val in col_vals:
               ...

  Parameters:

  - delimiter – one-character string used to separate fields.
  - doublequote – control how instances of quotechar in a field are quoted
  - escapechar – character to remove special meaning from following character
  - quotechar – one-character stringto quote fields containing special characters
  - quoting – control when quotes are recognised by the reader
  - skipinitialspace – ignore whitespace immediately following the delimiter

  Attributes Summary

  `delimiter` | str(object=’‘) -> string
  `doublequote` | bool(x) -> bool
  `escapechar` |
  `quotechar` | str(object=’‘) -> string
  `quoting` | int(x=0) -> int or long
  `skipinitialspace` | bool(x) -> bool

  Methods Summary

  `join`(vals) |
  `process_line`(line) | Remove whitespace at the beginning or end of line.

  Attributes Documentation

  `delimiter` = ' '
  `doublequote` = True
  `escapechar` = None
  `quotechar` = '"'
  `quoting` = 0
  `skipinitialspace` = True

  Methods Documentation

  `join`(vals)
  `process_line`(line)

    Remove whitespace at the beginning or end of line. This is especially useful for whitespace-delimited files to prevent spurious columns at the beginning or end. If splitting on whitespace then replace unquoted tabs with space first