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) 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; } out=""; for(i=1;i<15;i++){ out=out words[i]","; } out=out words[15]; print out; }else print x } line++; } }