I’m trying to remove the first 0 from the third column in my CSV file
tel.csv –
test,01test,01234567890
test,01test,09876054321
I have been trying to use the following with no luck –
cat tel.csv | sed 's/^0*//'
I’m trying to remove the first 0 from the third column in my CSV file
tel.csv –
test,01test,01234567890
test,01test,09876054321
I have been trying to use the following with no luck –
cat tel.csv | sed 's/^0*//'
3
Answers
Something like:
Or
awk
Assumptions:
0-9
)0's
Adding a row with a 3rd column that has multiple leading
0's
:One
awk
idea:Where: adding
0
to a number ($3+0
) has the side effect of removing leading0's
.If the third field is the last field, as it is in the sample lines: