Relevance to Parse "Paragraphs" of a File, like "file section" but with variant delimiters

So I am looking for something to do what “file section” does on INI formatted files, but for any format.
By INI formatted, I mean that “file section” inspector expects a file to look like this, with brackets denoting labels, and key=value pairs under each bracketed label:

[section_1]
line1=this is
line2=my first
line3=section

[section_2]
line1=this is
line2=my second
line3=section

Is there a way to use the “file section” inspector but alter these delimiters, or alternatively, what is the most intuitive way to create relevance to determine that certain “values” are associated to certain “keys” under certain “labels”?

We are looking to do this because, generally, AIX uses the following formatting with it’s configuration files:

section_1:
        line1 = thisis
        line2 = myfirst
        line3 = section

section_2:
        line1 = thisis
        line2 = mysecond
        line3 = section

The file section inspector is PERFECT except that it appears to be hard-coded for [these] types of labels. Essentially, we are writing tasks that make config changes and in order for them to be proper “Fixlets” I have to determine the relevance to parse files such as these to make sure the config was properly updated.

You got this resolved? I’m also looking for same thing to do via sections relevance

2 Likes

It’s a really strange coincidence, but I’m preparing to post exactly this scenario as a year-end bonus Relevance Challenge!

For me this came up in the context of parsing HP RAID utility output, searching for the SSD Firmware bug. What’s your use case?

Stay tuned, I’ll be posting the challenge later today, when I’m back at a keyboard. Send me a private message if you have an immediate need for this, though I can’t say for sure whether the solution I have is going to turn out to be the best; my solution performs well, but can be a bit difficult to read.

2 Likes

We never came up with the best way to do this so I would be interested in @JasonWalker method! :slight_smile:

I just posted the new challenge at Relevance Challenge December 2019 BONUS: Parsing Paragraphs, let’s see how many solutions we can find!

Thank you for the concern. We had found a solution for now so no immediate need of this relevance, and so would like to follow your challenge :slight_smile: