Extract specific value with AWK?

35 Views Asked by At

I have this file, pepe:

1.2345 2.3456 3.4567
4.5678 5.6789 6.8905

I want to print the value located at the second row and the third column:

6.8905

What I have tried is:

awk 'NR==2,{print $3}'

But, it is not working

1

There are 1 best solutions below

0
0stone0 On BEST ANSWER

You'll need:

awk 'FNR == 2 {print $3}' /path/to/pepe

Where FNR == 2 matches the second row for which we print the third column: {print $3 }