echo '1, "1,123", 10, 5, "3,123,234"' | sed '
:a
s/\("[0-9]*\),\([0-9,]*"\)/\1\2/g
ta
'
ta causes it to branch back to label "a" (defined by :a) if the search and replace was successful. This is to ensure that numbers in the millions (i.e. multiple commas) are handled properly by repeating the replacement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.