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*

2
  • As I noted in my answer, if the intention is to parse CSV, this doesn't work for the following input: printf "a,b foo,\"not a foo, delimiter\"\nd,e,foo g\n". Also, this doesn't decisively answer the question "Can that be done in one sed command in general so that I do not need shell piping?" Commented Sep 1, 2024 at 9:15
  • 1
    @Vilinkameni there's no indication in the question that this is to parse CSV in general (if there was then I'd have directed the OP to whats-the-most-robust-way-to-efficiently-parse-csv-using-awk) and it does answer the question by telling the OP to just do something simpler instead. Commented Sep 1, 2024 at 12:19