Link to home
Start Free TrialLog in
Avatar of petro2
petro2

asked on

Simple Awk

Simple AWK --- I have this in a file     Apr 02   and I want this Apr 2    I want to replace the only the leading 0 with a blank, I have tried using awk sub, (0,,file) and awk substr ($2,0,1) but I can not get the blank to work. Can I just delete the leading 0? Brain dead need help. thanks  

Avatar of ozo
ozo
Flag of United States of America image

awk 'gsub(/ 0+/," ")'
awk '{gsub(/ 0+/," ");print}'
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial