I have an issue converting decimal places of a particular column, i am using below script to get the output, but the output is not generating in desired format.
NR will always be > 0, so that if condition is pointless. Your FMT string is for one single number only, so the output will be very limited. Except for the header (which has an unnecessary comma in the end), your file has only records with 20 fields, so the enumeration of fields needn't be. ($7 > 0) implies ($7 != "") , so the latter can be left out. Try