proc getFromList { inputList pattern } {
foreach item $inputList {
    set f [lsearch $item $pattern]
    if { $f != -1 } {
        set value [lindex $item 1]
        return $value
        }
    }
return "error"
}
  
proc getComponent { inputText index } {
set comps [split $inputText]
return [lindex $comps $index]
}