Comment on Parsing JSON in Forty Lines of AwkparentComments−saghm1yI wonder if it's possible to encode the backspace character in the replacement string?−ZoomZoomZoom1yNo problem, there's \b. echo "one two three four five" | awk '{$3="\b"; print}' Inserts the backspace character (^H), which you can then remove with [global] substitution: awk '{$3="\b"; sub(/\32\b/, ""); print}' You can, of course, use an arbitrary sentinel value for the field to be deleted. Should work in gawk and BWK awk.
Comments
I wonder if it's possible to encode the backspace character in the replacement string?
No problem, there's \b.
Inserts the backspace character (^H), which you can then remove with [global] substitution: You can, of course, use an arbitrary sentinel value for the field to be deleted. Should work in gawk and BWK awk.