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
  • That field with the roles and the recipes are a single data field, which is the problem. I stripped out the quotation marks that were in it initially because I couldn't get any Regex pattern to treat it as a single field, but still separate the rest on a comma. I'll update the question with the raw data, that may help. It'll take me a few minutes Commented Jan 11, 2019 at 20:36
  • @Taegost they might be for csv, but they aren't for awk. Commented Jan 11, 2019 at 20:39
  • Correct, which is the entire point of the regex: To separate the fields by a comma, except for the ones that include multiple entries (the role and recipe fields), where everything within the brackets needs to be treated as a single field Commented Jan 11, 2019 at 20:42
  • If you're using the same character to delimit data and also as part of the data, you're going to have a bad time. Commented Jan 11, 2019 at 20:52
  • @Taegost given your input data, you can use the fact that you only want the text until the first ]. But a dedicated CSV parser is a safer approach. Commented Jan 11, 2019 at 21:24