pydata/pandas — pull request #952 by blais (2012-03-22 15:10:38+00:00)
Title: Added support for read_fwf() as in R.

I added a simple function like R's read_fwf().

It also made sense to refactor read_csv() and read_table() to redirect to a new function _read() which takes the parser's class as input. I needed this for the FixedWidthFieldParser which needs to override the TextParser in order to provide a custom reader for the fields. Please review; the tests pass.

Also, I made the column spec ("widths")
- zero-based, and
- inclusive on both the from and to fields (e.g., a colspec of (1,2) has two characters)
I'm not sure that's the best; I think in practice a lot of column format specs start counting at one, but I haven't done a survey or anything, feel free to change it. Maybe we should support both.