[AstroPy] reading fixed format tables

Erin Sheldon erin.sheldon at gmail.com
Mon Dec 5 15:42:27 EST 2011


The recfile packages is designed to do that.  Files can be binary, as I
think you are specifying, or ascii.  You specify the dtype for each row
as when constructing an array with fields.

  http://code.google.com/p/recfile/

This is C++ code linked to python, so it's fast.  You can also specify
arbitrary subsets of the data to read based on column name and row
number, and only those data are read.

I recommend checking out from trunk; I've had some bug fixes that
haven't been released yet.
-e

On Mon, Dec 5, 2011 at 3:36 PM, Wolfgang Kerzendorf
<wkerzendorf at gmail.com> wrote:
> Hello,
>
> I'm looking for a fixed format table reader. Fixed format like in the
> fortran definition(no spaces, just a prescribed formatting).
>
> e.g. FORMAT(F11.4,F7.3,F6.2,F12.3,F5.2,1X,A10,F12.3,F5.2,1X,A10,
>
> 3F6.2,A4,2I2,I3,F6.3,I3,F6.3,2I5,1X,A1,A1,1X,A1,A1,i1,A3.2I5,I6)
>
>
> Does atpy do that? Is there any other package that does that or do I need to
> role my own?
>
> Cheers
>   W
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>



-- 
Erin Scott Sheldon
Brookhaven National Laboratory



More information about the AstroPy mailing list