Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing FIL file with Python 1

Status
Not open for further replies.

rybose

Mechanical
Dec 15, 2008
32
Hello all,

I am looking to access the .FIL file instead of going through the .ODB. The Abaqus documentation says that each entry is 8 bytes long whether it's a string, float, or integer.

I am trying to used the struct module to convert the binary. I am unsure what format to use to read 8 byte integers.

For a first step I am simply trying to print the record length and record type key - the first 16 bytes of each entry.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
import struct

sFileName = 'shellMeshStatic.fil'
f = open(sFileName,'rb')

for x in f.readlines():
q = struct.unpack('<qq',x[0:16])
print q, len(x)

f.close()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I seem to be getting garbage. Has anyone done this before? Any help would be great.

-Ryan
 
Replies continue below

Recommended for you

any reason for preferring .fil? I think it is more of a legacy file and does not contain as much data as .odb.
 
The reason I want to get away from the ODB is that you have to have ABAQUS/CAE open to access it. I find this a little cumbersome.

I am writing some utilities to analyze post-buckling of stiffened panels. The models are generated as Nastran files from another code. I am trying to do the pre and post processing with a single IronPython application with a GUI interface designed using the (free) SharpDevelop IDE.

On johnhors suggestion, I am parsing the ascii file instead. It is pretty straightforward parse the ascii FIL since you can physically see how the data is patterned.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor