[Numpy-discussion] read ascii file from complex fortran format() -- genfromtxt
Andrew Jaffe
a.h.jaffe at gmail.com
Wed Sep 22 06:55:18 EDT 2010
On 21/09/2010 18:29, David Huard wrote:
> Have you tried
>
> http://code.google.com/p/python-fortranformat/
>
> It's not officially released yet but it's probably worth a try.
Well, I noticed it, bugt the website does say "This is a work in
progress, a working version is not yet available"!
Andrew
>
> David H.
>
> On Tue, Sep 21, 2010 at 8:25 AM, Andrew Jaffe <a.h.jaffe at gmail.com
> <mailto:a.h.jaffe at gmail.com>> wrote:
>
> Hi all,
>
> I've got an ascii file with a relatively complicated structure,
> originally written by fortran with the format:
>
> 135 format(a12,1x,2(f10.5,1x),i3,1x,4(f9.3,1x),4(i2,1x),3x,
> 1 16(f7.2,1x),i3,3x,f13.5,1x,f10.5,1x,f10.6,1x,i3,1x,
> 2 4(f10.6,1x),
> 2 i2,1x,f5.2,1x,f10.3,1x,i3,1x,f7.2,1x,f7.2,3x,4(f7.4,1x),
> 3 4(f7.2,1x),3x,f7.2,1x,i4,3x,f10.3,1x,14(f6.2,1x),i3,1x,
> 1 3x,2f10.5,8f11.2,2f10.5,f12.3,3x,
> 4 2(a6,1x),a23,1x,a22,1x,a22)
>
> Note, in particular, that many of the strings contain white space.
>
> Is there a relatively straightforward way to translate this into dtype
> (and delimiter?) arguments for use with genfromtxt or do I just have to
> do it by hand?
>
> Andrew
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org <mailto:NumPy-Discussion at scipy.org>
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
More information about the NumPy-Discussion
mailing list