Hi,
I need to execute a script which parses through the data line, by line. While going through the data, I come across lines which contain unbalanced braces within the data.
I was able to assign it to a list, however, while performing something like
set x [lindex $line 0]
,an error is reported mentioning there's an unbalanced brace. Now, I tried using the split function but it leads to unnecessary empty elements if there's whitespace anywhere in the line, which sounds inefficient and also doesn't help my cause(coz now my problem is deleting the extra elements, and I would need lindex 1,2... I guess u get the point...)
Also, quite obviously, I can't go ahead and manipulate the data and fetch any random [lindex $temp_line 0]
% gets $file_handler line
# Let line value be
#
# assign some_thing = {some_thing1, some_thing2,
% set temp_line $line
% set x [lindex $line 0]
>> ERROR!!
Please help me out !! (I've been cracking my head over this for some time now!! I've tried using regexp, regsub too!!)
I need to execute a script which parses through the data line, by line. While going through the data, I come across lines which contain unbalanced braces within the data.
I was able to assign it to a list, however, while performing something like
set x [lindex $line 0]
,an error is reported mentioning there's an unbalanced brace. Now, I tried using the split function but it leads to unnecessary empty elements if there's whitespace anywhere in the line, which sounds inefficient and also doesn't help my cause(coz now my problem is deleting the extra elements, and I would need lindex 1,2... I guess u get the point...)
Also, quite obviously, I can't go ahead and manipulate the data and fetch any random [lindex $temp_line 0]
% gets $file_handler line
# Let line value be
#
# assign some_thing = {some_thing1, some_thing2,
% set temp_line $line
% set x [lindex $line 0]
>> ERROR!!
Please help me out !! (I've been cracking my head over this for some time now!! I've tried using regexp, regsub too!!)