I'm looking for general guidance/suggestions on how to extract grid data points from a text file. Lines beginning with "GRID*" have node numbers and x y z coordinate information. I would like to extract that information. Each "GRID" line is segmented into '6' columns. The first and last column are eight characters wide, columns 2,3,4, and 5 are 16 characters wide. An example coordinate would be '-3.69374569427+0'. I would also like to know how to convert that format into a real number. I studied the "strings" documentation but haven't found an answer on my own yet. Any help/suggestions/guidance appreciated.
Thanks!,
Andrew
sample file contents:
PS.
I tried to show the "column widths" in the sample file contents but the forum post removes the white space. The coordinate information begins in column 4 and continues on the next line. For anyone curious, this is from a NASTRAN input file
Thanks!,
Andrew
sample file contents:
Output:GRID* 1 0-3.69374569427+09.077207667771+0
* 5.000014684254-1 0
GRID* 2 0-3.69374569427+0-9.07720766777+0
* 4.999985315745-1 0
GRID* 3 08.978071514315+03.928573996764+0
* 4.999963281080-1 0
GRID* 4 08.978071514315+0-3.92857399676+0
* 5.000036718919-1 0
etc..PS.
I tried to show the "column widths" in the sample file contents but the forum post removes the white space. The coordinate information begins in column 4 and continues on the next line. For anyone curious, this is from a NASTRAN input file