As for this Command:
awk '{for(x=1;x<=NF;x++)if($x~/0.00000/){sub(/0.00000/,++i)}}1'
I know this command will look for "0.00000" in a file and replace it with an incremental number starting from 1. I understood almost everything except for 'x<=NF' and the number 1 at the end "{sub(/0.00000/,++i)}}1'. Can you enlighten me on these two points, please?
Also, If I want to do the same thing but replacing the match with an incremental number starting from 0, would it be correct to do:
awk '{for(x=0;x<=NF;x++)if($x~/0.00000/){sub(/0.00000/,++i)}}1' file