I have another question I am stuck at :wall:
I have a text file with two columns, like so...
2 0.0627279
3 0.0794451
4 0.108705
5 0.137739
6 0.190394
7 0.217407
8 0.241764
9 0.344458
10 0.460762
I'd like to go through the file line by line until the value in the second column exceeds a predefined cutoff. Then the line is written out and the cutoff value is doubled.
So say for SPACE=0.05 I want to get an output:
2 0.0627279
4 0.108705
6 0.190394
7 0.217407
9 0.344458
10 0.460762
I have...
awk 'BEGIN{space='$SPACE'}{if ($2 > space) print $0; space=space*2}' < input.dat
"space=space*2" doesn't seem to be working. Any help fixing this?
Cheers