BEGIN{ line=1; while(getline x < F){ if(line%2!=0){ split(x,words,","); if(words[10]<50){ changed=0; if(words[12]==1||words[13]==1||words[14]==1||words[15]==1||words[16]==1||words[17]==1||words[18]==1||words[19]==1||words[20]==1||words[21]==1) changed=1; if(words[12]==1002&&changed==0){ words[12]=1; changed=1; } if(words[13]==1002&&changed==0){ words[13]=1; changed=1; } if(words[14]==1002&&changed==0){ words[14]=1; changed=1; } if(words[15]==1002&&changed==0){ words[15]=1; changed=1; } if(words[16]==1002&&changed==0){ words[16]=1; changed=1; } if(words[17]==1002&&changed==0){ words[17]=1; changed=1; } if(words[18]==1002&&changed==0){ words[18]=1; changed=1; } if(words[19]==1002&&changed==0){ words[19]=1; changed=1; } if(words[20]==1002&&changed==0){ words[20]=1; changed=1; } if(words[21]==1002&&changed==0){ words[21]=1; changed=1; } out=""; for(i=1;i<20;i++){ out=out words[i]","; } out=out words[21]; print out; }else print x } line++; } }