Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 3
    I wonder if it would anger the awk gods if you simply forced numeric conversion of the field i.e. awk -F, '/received/ {print $2+0}' ? Commented Apr 4, 2022 at 16:41
  • What is the function of sub and "" in the parenthesis)? Commented Apr 4, 2022 at 17:39
  • /received/ {sub(/received/, "", $2); print $2} = sub(/received/, ""){print $2} in this case, but it still leaves undesirable blanks either way. Commented Apr 4, 2022 at 17:40
  • +1 for answering the question as asked, rather than providing workarounds. You never know when someone will actually need 2 separate delimiters an stumble on this thread. Commented Apr 5, 2022 at 14:09
  • 1
    @shadowtalker Conversely, sometimes they're asking the wrong question, i.e. it's an XY problem. Commented Apr 6, 2022 at 14:51