×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Parsing FIL file with Python

Parsing FIL file with Python

Parsing FIL file with Python

(OP)
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

RE: Parsing FIL file with Python

It's a lot easier if you use an ascii fil file instead. The binary fil can be converted to ascii by Abaqus.


www.Roshaz.com

RE: Parsing FIL file with Python

any reason for preferring .fil? I think it is more of a legacy file and does not contain as much data as .odb.
 

RE: Parsing FIL file with Python

(OP)
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.

RE: Parsing FIL file with Python

You might want to look at the fil file in a hex editor and make sure what you think you are reading is what you are actually reading. smile

TOP
CSWP, BSSE
www.engtran.com  www.niswug.org

"Node news is good news."

RE: Parsing FIL file with Python

Kellnerp, with the ascii version of the fil file output, any text editor will suffice to correctly see the file contents.


www.Roshaz.com

RE: Parsing FIL file with Python

Johnhors,

I know that. But he was reading a binary file. Only a hex editor will let him see what is in it. I agree exporting as ascii makes a lot more sense.

TOP
CSWP, BSSE
www.engtran.com  www.niswug.org

"Node news is good news."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources