Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Dec 15, 2008
Messages
32
Location
US
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
 
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.
 
Kellnerp, with the ascii version of the fil file output, any text editor will suffice to correctly see the file contents.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top