how to fetch a line from a text DAT

I have a text dat in which I store something like:

set button_sx = 100
set button_sy = 50

panel_tab DEVELOPER {
size $gUI_SIZEX $gUI_SIZEY
bgcolor .5 .5 .5
button_clear TEST {
pos 0 0
size $button_sx $button_sy
text some text
bgcolor .8 .8 .8
}
}

I want another script to parse this DAT line by line, keeping just one space where there’s one or more tabs and one or more spaces.

The only way I can think of doing that is to have a loop to get each column of an individual row, and make sure there’s only one space where there may be two, etc.

Something I’d like to have is obviously a tab function that returns more than one cell - would be very useful.

or better yet, a function that returns a line from a text dat.

any other way you guys can think of of parsing a text dat? Maybe the new evaluate dat?

d

Hey Dani,

I think it would help you to use a convert dat and convert the text dat into a table. Now you have row by row access. Parsing through it can be done with an evaluate DAT and the proper expressions… also to replace tabs with spaces you can use the merge DAT and it’s how parameter “concatenate columns”

hope that helps
markus