How do I parse a curly bracket structured file (e.g. Ruby)?
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)
Try any proper parsers generator, for example http://treetop.rubyforge.org/
精彩评论