I have a string of text that I need to split into a list so that I can assign the information accordingly. Below I have a sample of the text. This is what I need done.
First split the string on the : (colon) then search the first column of te split for a keyword, if it has the word in it then append it to another list. and so on. I figured the easiest way would to put the each section separated by the : into an element of an array or something, but I just don't know tcl that well. Can anyone help?
set string "info,(info2):info,(info2):info,(info2):info,(info2):info,(info2):info,(info2)"
foreach info [split $string :] {
if {[string match -nocase *keyword* $info]} {
#matched
}
}
this will search for keyword in every info between ':'