Thanks for your reply....
But this block is giving error
possibly the simple one... but i m not good in awk programming), so pls suggest what wrong i m doing
awk 'BEGIN {
> FS = ","; te = "tmp"; be = "bad"
> ffn = fn = ARGV[2]; sub(/[^.]*$/,"", fn)
> }
> {
> print > (fn (NF != nf + 1 ? be : te))
> }
> END {
> if (system("mv " fn te OFS ffn)) {
> print "error moving", fn te, "to", ffn | "cat >&2"
> exit 1
> }
> }' nf="$row_comma" cmt.csv
mv: cannot stat `cmt.tmp': No such file or directory
error moving cmt.tmp to cmt.csv