How do I parse a curly bracket structured file (e.g. Ruby)?
-
25-10-2019 - |
Question
The contents of the file looks like (any deep possible):
{
{bla: XBS/333: bla9,1-}
}
{
{q: XBS/333: bla9,1-}
{{}}
{x:{t: QWA/333: C}}
}
How do I parse it to e.g. an Array or a Hash with Ruby? What do you think is a good data structure object to store it to?
(It's a SWIFT-Banking file, if that helps)
Solution
Try any proper parsers generator, for example http://treetop.rubyforge.org/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow