Conavert negative values to Zeros

Can anyone please assist me?
Please find the attached input and output file for ur reference.

a)Incase if i get negative value (ex:-000100) in the 11th column then i have to convert the value to 0000000(7 zeros-length is 7) and then
print the entire record.
b)Incase if there is no negative value present in the 11th column , then print all records as it is.

awk -F"." -v OFS="." '($11 ~ /-/) { $11="0000000" } 1' infile > outfile
1 Like

Split your unrelated question to this new thread.