perform some operation on a specific coulmn starting from a specific line

I have a txt file having rows and coulmns, i want to perform some operation on a specific coulmn starting from a specific line.

eg:

 50.000000               1           1           1
  1000.00000    
  1000.00000    
   50000.000    
     19
     19
  3.69797533E-07   871.66394       36.611320      -12.000000      -35.290180          4      5
  1.13238150E-06   879.03741       36.047676      -10.800000       38.395638          4      4
  6.69133044E-07   717.85254       34.777313      -9.1999998       24.722189          3      3
  8.59679221E-06   381.38339       33.485676      -8.0000000       14.840780          1      1
  5.23395693E-06   247.83061       33.334003      -5.5999999      -5.1661811          0      1
  6.89546050E-06   259.99509       33.329212      -5.1999998      -6.1069846          0      1

I want to select the data from 3rd coulmn from 7th line to end of clm. And find out the minimum and the maximum out of them.

my idea (but do not knw hw to proceed)
1 : mv the txt file to a csv file and then copy only the required column from a specified row to txt file and then perform operation to find (min / max)

how do i proceed with this problem.

awk 'NR==7{min=$3;max=$3}NR>7{if ($3>max){max=$3};if ($3<min){min=$3}}END{print "min: "min" max: "max}' file
1 Like

the code works perfect, is it possible to give a little more explanation on the command used

Thank you bartus11

if you want to calculate the difference between the outputs,

awk 'NR==7{min=$3;max=$3} NR>7{if ($3>max){max=$3};if ($3<min){min=$3}}END{delay=max-min;print "To: "min"  Tmax : "max" delay= "delay }' file > outputfile