I'm trying to extract field values from a text file which is formatted as follows:
{fieldvalue1} {fieldvalue2} {fieldvalue3}
However, the field values themselves can contain subfields that are themselves delimited with curly brackes, for example:
{abc} {xyz} {efg {123} {pqx}}
So in the above case the desired output is:
* fieldvalue1 = abc
* fieldvalue2 = xyz
* fieldvalue3 = efg {123} {pqx}
I tried the following filter:
sed 's/^{//g;s/}$//g' | awk -F"} {"
However this obviously failed to correctly parse fieldvalue3 above.