I need to strip some leading zeros in a field that I have extracted from a UNIX text file using awk.
There are two scenarios.
1. The field consistently has a single zero on the left of every row. Unless there is a better way I will use substr() to get rid of that
2. The field has a variable number of zeros padding it on the left. I need to strip away the zeros until I get to the first non-zero character then leave it at that. If I add zero to the field and print the result, will that work? or is there a better way?
1. 020090101 becomes 20090101
2. 00087887887 becomes 87887887
00232200222 becomes 00232200222
1118818100 stays as it is