I have blocks like
<block>
6 3 0.3464400E-01 0.4497077E+03 0.7546771E-02 0.1037429E+00
21 -1 0 0 501 502 0.00000000000E+00 0.00000000000E+00 0.27717368685E+03 0.27717368685E+03 0.00000000000E+00 0. 1.
</block>
but also
<block>
4 1 0.3464400E-01 0.3573334E+03 0.7546771E-02 0.1068535E+00
6 1 1 2 501 0 -0.28596283579E+03 -0.12710688463E+03 0.60083326400E+02 0.36234949936E+03 0.17250000000E+03 0. -1.
</block>
What I need, is to look only in the first line after the "block" and only if a "4 1" pattern is true, then replace the 4rth column with another number but all other lines should remain untouched. I found this How to replace the nth column/field in a comma-separated string using sed/awk? but was not very helpful in my case (my columns are space separated). Sorry in advance if this already a possible duplicate...