2 added 2 characters in body
source | link

If you don't need to keep the whitespace exactly the same, this works:

$ perl -lane '$F[3]=$F[4]=$F[5]=$F[6]="0'do{$_=sprintf("%.00000000"8f",0) for @F[3..6]} if $F[6]>1; print "@F"' file 
0.04718683 0.24081557 0.02831210 0.00000000 0.00000000 0.00000000 0.00000000 
0.05662420 0.24081557 0.02831210 -0.00006975 0.00001697 -0.00144172 0.00144350
0.06606157 0.24081557 0.02831210 0.00039672 0.00007192 -0.00001264 0.00040339
0.07549894 0.24081557 0.02831210 0.00087559 0.00010765 -0.00028455 0.00092694
0.08493630 0.24081557 0.02831210 0.00004609 0.00012754 -0.00030319 0.00033214
0.09437367 0.24081557 0.02831210 -0.00038816 0.00008384 0.00011519 0.00041348

To skip a certain number of lines, just test for the value of $. (the current line number):

$ perl -lane '$F[3]=$F[4]=$F[5]=$F[6]="0'do{$_=sprintf("%.00000000"8f",0) for @F[3..6]} if $F[6]>1 && $.>3; print "@F"' file 

If you don't need to keep the whitespace exactly the same, this works:

$ perl -lane '$F[3]=$F[4]=$F[5]=$F[6]="0.00000000" if $F[6]>1; print "@F"' file 
0.04718683 0.24081557 0.02831210 0.00000000 0.00000000 0.00000000 0.00000000 
0.05662420 0.24081557 0.02831210 -0.00006975 0.00001697 -0.00144172 0.00144350
0.06606157 0.24081557 0.02831210 0.00039672 0.00007192 -0.00001264 0.00040339
0.07549894 0.24081557 0.02831210 0.00087559 0.00010765 -0.00028455 0.00092694
0.08493630 0.24081557 0.02831210 0.00004609 0.00012754 -0.00030319 0.00033214
0.09437367 0.24081557 0.02831210 -0.00038816 0.00008384 0.00011519 0.00041348

To skip a certain number of lines, just test for the value of $. (the current line number):

$ perl -lane '$F[3]=$F[4]=$F[5]=$F[6]="0.00000000" if $F[6]>1 && $.>3; print "@F"' file 

If you don't need to keep the whitespace exactly the same, this works:

$ perl -lane 'do{$_=sprintf("%.8f",0) for @F[3..6]} if $F[6]>1; print "@F"' file 
0.04718683 0.24081557 0.02831210 0.00000000 0.00000000 0.00000000 0.00000000 
0.05662420 0.24081557 0.02831210 -0.00006975 0.00001697 -0.00144172 0.00144350
0.06606157 0.24081557 0.02831210 0.00039672 0.00007192 -0.00001264 0.00040339
0.07549894 0.24081557 0.02831210 0.00087559 0.00010765 -0.00028455 0.00092694
0.08493630 0.24081557 0.02831210 0.00004609 0.00012754 -0.00030319 0.00033214
0.09437367 0.24081557 0.02831210 -0.00038816 0.00008384 0.00011519 0.00041348

To skip a certain number of lines, just test for the value of $. (the current line number):

$ perl -lane 'do{$_=sprintf("%.8f",0) for @F[3..6]} if $F[6]>1 && $.>3; print "@F"' file 
1
source | link

If you don't need to keep the whitespace exactly the same, this works:

$ perl -lane '$F[3]=$F[4]=$F[5]=$F[6]="0.00000000" if $F[6]>1; print "@F"' file 
0.04718683 0.24081557 0.02831210 0.00000000 0.00000000 0.00000000 0.00000000 
0.05662420 0.24081557 0.02831210 -0.00006975 0.00001697 -0.00144172 0.00144350
0.06606157 0.24081557 0.02831210 0.00039672 0.00007192 -0.00001264 0.00040339
0.07549894 0.24081557 0.02831210 0.00087559 0.00010765 -0.00028455 0.00092694
0.08493630 0.24081557 0.02831210 0.00004609 0.00012754 -0.00030319 0.00033214
0.09437367 0.24081557 0.02831210 -0.00038816 0.00008384 0.00011519 0.00041348

To skip a certain number of lines, just test for the value of $. (the current line number):

$ perl -lane '$F[3]=$F[4]=$F[5]=$F[6]="0.00000000" if $F[6]>1 && $.>3; print "@F"' file