R
Rodrigo Bermejo
Dear ruby-list /.
I have a text I file where I need to parse out all Table data-text
similar to the one below.
------------
more code
....
Table MyTable (real a, real b) {
settings="default";
a= 0 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
b= 1 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
c= 2 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
d= 3 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
}
....
more code
------
The table code could have different number of elements (a,b,c,d).
I know one approach would be to count the number of brackets found until
you match your 1st bracket.
I suspect there can be many elegant solutions to this problem , so any
charming idea/solution is very welcomed.
-ronnie bermejo.
I have a text I file where I need to parse out all Table data-text
similar to the one below.
------------
more code
....
Table MyTable (real a, real b) {
settings="default";
a= 0 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
b= 1 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
c= 2 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
d= 3 {
max= { 0,0,0,0}
mix = { 0,0,0,0}
}
}
....
more code
------
The table code could have different number of elements (a,b,c,d).
I know one approach would be to count the number of brackets found until
you match your 1st bracket.
I suspect there can be many elegant solutions to this problem , so any
charming idea/solution is very welcomed.
-ronnie bermejo.