in reply to Parsing bracket formatted file
> The overall record is enclosed with brackets and is composed of KEY, VALUE pairs.
doesn't fit the demonstrated sample. There are more types like LIST and QUOTED-STRINGS and especially the first "KEY" (?) sys ecm cloud-provider /Common/aws-ec2 is very confusing.
You should better provide an SSCCE (update: especially the expected output)
> Any advice on the best way to approach it would be greatly appreciated!
Regarding recursive structures
> the VALUE, which can be simple text or another bracketed sub-record.
you might want to have a look at
FWIW: I think after tr/-/_/ I could parse this as a non-strict Perl DSL, just by predefining the key-words as subs. But w/o better specification (whats a keyword, what a bareword/string) of the desired outcome, there is no point in attempting it.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|