I have multiple drawing files in the format detailed below. I need to increase the value of a number in the area of the file below after the line BO. All values (in the sample below) that are 14.00 need to be increased by 1 to 15.00. In this case, the 5 lines below BO would become 15.00. I can see that $4+1 will increase the value, however, the two decimal places are missing.  I can see that gawk allows for C like expressions so would be a solution. What I cannot understand is how to detect the BO record and then manipulate the fields until EN is reached.  Any advice on how this could be achieved is appreciated.Thank you.AK  v       0.00u      0.00       0.00       0.00       0.00       0.00       0.00        398.56       0.00       0.00       0.00       0.00       0.00       0.00        398.56      50.00       0.00       0.00       0.00       0.00       0.00          0.00      50.00       0.00       0.00       0.00       0.00       0.00          0.00       0.00       0.00       0.00       0.00       0.00       0.00BO  v      25.00o     18.75      14.00  v      75.00o     18.75      14.00  v     323.56o     18.75      14.00  v     373.56o     18.75      14.00EN
Using gawk to alter columns after a line identifier
awk;gawk;math
This can be achieved through the use of a very simple state-machine:$ awk -v OFS=\t '/^[A-Z][A-Z]/ && !/^BO/ { flag=0 } /^BO/ { flag=1 } flag == 1 && NF == 4 { $4 = sprintf(%.2f, 1+$4) } { print }' fileAK  v       0.00u      0.00       0.00       0.00       0.00       0.00       0.00        398.56       0.00       0.00       0.00       0.00       0.00       0.00        398.56      50.00       0.00       0.00       0.00       0.00       0.00          0.00      50.00       0.00       0.00       0.00       0.00       0.00          0.00       0.00       0.00       0.00       0.00       0.00       0.00BOv       25.00o  18.75   15.00v       75.00o  18.75   15.00v       323.56o 18.75   15.00v       373.56o 18.75   15.00ENThe script does nothing but pass along the input to the output until it hits the line starting with BO, then it sets flag to 1.If flag is 1 and the current line contains four columns, the fourth column is reformatted using sprintf() and 1+$4.  The format specification %.2f means a floating point value with two decimal places.If something other than BO is found at the start of the line, flag is reset to zero.The padding between the columns are changed on the output lines where a modification has been made.  This is because awk splits the fields on whitespaces and then rejoins them using OFS (set to a tab character here) when the output happens.To get exactly the same output format as the input, you may do something like$ awk -v OFS=\t '/^[A-Z][A-Z]/ && !/^BO/ { flag=0 } /^BO/ { flag=1 } flag == 1 && NF == 4 { printf(%3s %11s%10.2f %10.2f\n, $1,$2,$3,1+$4); next } { print }' fileAK  v       0.00u      0.00       0.00       0.00       0.00       0.00       0.00        398.56       0.00       0.00       0.00       0.00       0.00       0.00        398.56      50.00       0.00       0.00       0.00       0.00       0.00          0.00      50.00       0.00       0.00       0.00       0.00       0.00          0.00       0.00       0.00       0.00       0.00       0.00       0.00BO  v      25.00o     18.75      15.00  v      75.00o     18.75      15.00  v     323.56o     18.75      15.00  v     373.56o     18.75      15.00EN