BEGIN { IGNORECASE = 1; # Ignore case in string comparisons. FS = ","; # Initialize the field separator. OFS = ","; # Initialize the output field separator. Skip = 1; # Set to 1 or 2 if this is a csv file and we should skip the header line. TargetColumns = "-6-7-8-9-10-"; Digits = 2; } FNR <= Skip { print $0; next } # Ignore Skip number of the beginning records. { for(I=1; I<=(NF-1); I++) { target="-"I"-"; if (index(TargetColumns, target)!=0) { printf("%."Digits"f,", $I); } else { printf("%s,", $I); } } I=NF; target="-"I"-"; if (index(TargetColumns, target)!=0) { printf("%."Digits"f", $I); } else { printf("%s", $I); } printf("\n"); }