#!../src/tops  -s ../sys  -u ../usr 

# Scan a Nastran OUTPUT2 file

# March 2005

#-----------------------------------------------------------------------

"scanop2" is script_name
"Usage: scanop2 <Nastran OUTPUT2 filename>" is usage

# At least 2 command line argvs (script name and file name):
ARGV rows 2 < IF usage . nl halt THEN

# Next-to-last argv is script name:
ARGV these rows 1 less ndx quote -path script_name alike not
IF usage . nl halt THEN

# Last argv is the input file name:
ARGV these rows ndx quote strchop "FILE" book

FILE file? not IF "file not found: " . FILE . nl halt THEN

#-----------------------------------------------------------------------

"nas.v" source             # include Nastran utilities
FILE old binary "BIN" file # open file, make handle called BIN
BIN op2file out cr0        # map the OP2 file, clear comment from screen

"Name Rec Titles: Cols Rows Form Type Nzwd %Dens*100" # column titles

BIN "toc2" >stk asciify    # run toc2 with output table to stk
left justify pile neat     # pile titles, neat columns

"Trailer titles apply to matrices, not tables" pile dot nl # footnote
