let's consider the following example
1 4.0 3.5 7.2
2 3.2 2.5 5.2
3 1.7 -1.8 2.9
4 4.1 2.5 5.7
How can I extract the 3rd column of the table by ignoring the negative number?
If I use awk '{print $3}' filename
, it will give me all the four numbers. But I want to take only positive numbers, i.e. the final output must be three numbers:
3.5
2.5
2.5
How can I do that?