I have the following awk script that sets a flag to 1 if Left is matched on a line, until that time left == 0. Then whenever the first field ($1) is between 1 and 100 I want to print $1 and if it is left or not. But whatever I try the value of $left is always the same as $1.
Does anybody know what I'm doing wrong?
Code:$3 ~ /Left/ { left=1 } $1 >= 1 && $1 <= 100 \ { printf " ""%d"" ""%d"">\n", $1, $left }