I’ve got a file that contains two delimiters (“:” and “,“), and I basically want something like a nested/recursive AWK command that will let me iterate over the values I want:
Value-1.1:Value-1.2:Value-1.3:Value-1.A,Value-1.B,Value-1.C
Value-2.1:Value-2.2:Value-2.3:Value-2.A,Value-2.B
For every Value-1.{A|B|C} I want to do something with Value-1.2, and then move on to the next line, where for every Value-2.{A|B}, I want to do something with Value-2.2, and so on.
Is this something I can do in a single AWK script, or am I going to need to be creative with pipes?
Thanks.
Awk uses a regular expression to indicate the field separator. E.g.,
will show
for your input lines.