A file
2400 2800 PSC000289
3200 3896 PCS000289
3333 3666 PCS000221
222 1000 PCS000222
3299 3600 PSC000289
Question is while if third column is PCS000289
and first column should be greater than 3000, then replace PCS000289 by YES,
remaining the others column same.
the output file should be
2400 2800 PSC000289
3200 3896 YES
3333 3666 PCS000221
222 1000 PCS000222
3299 3600 YES
awk '{if (($3="PSC000289") && ($1>3000)) {gsub(/PSC000289/ ,"YES")};1'} <file
but it is not working? any guess.