Apologies if answered already somewhere here, I've searched the forum and couldn't find it though...
I'm trying to transform a structured text file - not any well-known formats like json, xml etc., but well-structured:
var1 set <value1>
var2 set <value2>
var1 set <value3>
var2 set <value4>
How to transform it into table where the rows are grouped by Leveln, then Leveln_m and columns are values respectively?
I'm not a programmer, although familiar with simple programming, so I'd appreciate help for not-so-stupid-but-not-a-coder ;-)
I'm not quite sure how your output table should look like. Can you provide the table to your text-example?
I would take something like:
or CSV like this:
There are at least two ways to tackle the problem, unfortunately none of them are trivial absent the JSON or XML format:
1) transform your structured text file such that it will look like JSON format so to finally be able to use JSON Path - this requires alot of text parsing nodes (String Manipulation) ;
2) walk through each line, as many times as you have levels and to extract the var-value pairs directly - here you'll need to come up with an algorithm to extract the parent level information from each line;
Thanx, I was suspecting it wouldn't be easy :(
Although arduous, the second looks promising, I'll have to get my hands dirty, since there's no alternative...
It might be a little to late for Marcin, but for the reference here is a workflow that does what you were looking for.