Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello all,
I wrote a parser for an old kicad brd file a while back that reads all the file contents into a hash so I can make what ever mods to the file that my mind sees fit. Recently, the Kicad maintainers moved to a new format that is compartmentalized with parentheses. The content is basically the same, but the format is a total change. I've just started to think about the best way to parse the file into the same hash structures so the data manipulation on the backend doesn't need to change too much. In an ideal world this is what I would like to happen: File foo.kicad_pcb:
Perl Hash would look like this:
I've looked at a perl module called Text::Balanced but can't seem to make it do what I need (I think my brain stopped working about an hour ago). Anyway, I'm reaching out to see if someone might be able to point me in a better direction. It just seems like there should be an elegant way to do this with out counting parentheses and tracking every thing... aka not the way I would do it in C... In reply to Parsing a file with parentheses to build a hash by xcellsior
|
|