Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ZoomZoomZoom
on June 28, 2025
|
parent
|
context
|
favorite
| on:
Parsing JSON in Forty Lines of Awk
No 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.
Consider applying for YC's Fall 2026 batch!
Applications
are open till July 27.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: