example.csv

Type,LCID,EID,Nx,Ny,Nxy,Mx,My,Mxy,Qyz,Qxz
QUAD,5000001,389635,5.21044,0.9993295,3.184029,0.228490059,0.762438914,0.349926963,0.007402616,0.645762323
QUAD,5000002,389636,4.332321,-45.55149,10.13951,0.128933201,0.289045003,0.442976734,0.394346902,0.965424659
QUAD,5000003,389637,5.332321,-65.55149,12.32391,0.867613103,0.345799842,0.902593358,0.56308979,0.77084519
QUAD,5000004,389638,4.332321,-35.55149,14.27251,0.429855813,0.882431001,0.15453015,0.710809946,0.918974895
QUAD,5000005,389639,5.332455,-75.55149,15.37321,0.738401857,0.289007109,0.59902178,0.824840285,0.571976301
QUAD,5000006,389640,4.332321,-65.55149,13.27221,0.102678011,0.581496802,0.785601755,0.415283869,0.817283531
QUAD,5000007,389641,3.332321,-45.55149,12.67351,0.363658748,0.803570041,0.70688413,0.459446702,0.330453157

ex370.txt

awk 'NR==2 || $4 < min {min=$4} END{ print "min=" min}' FS=, OFS=, example.csv
awk 'NR==2 || $4 > max {max=$4} END{ print "max=" max}' FS=, OFS=, example.csv

output:

min=3.332321
max=50.332455

ex370.txt

awk 'BEGIN{min=1.0E6}{if ($4<0+min) min=$4} END{print "min=" min}' FS=, OFS=, example.csv
awk 'BEGIN{max=-1.0E6}{if ($4>0+max) max=$4} END{print "max=" max}' FS=, OFS=, example.csv

output:

min=3.332321
max=50.332455

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading