title: TCL string match from file
body: <p>I am trying to find a string in a file in TCL.  Using the wish console, I get a successful match between two strings.  When I read a string from a file and match it to its exact copy, it fails.  I can see in Eclipse that the variables contain exactly the same string...that is unless there are invisible characters trailing.  The following code never returns 1, even when the variables contain exactly the same strings.</p>
  
  <pre><code>set fileId [open $::InputFile "r"]
  set file_data [read $fileId]
  #  Process data file
  set data [split $file_data "\n"]
  #search for string
  foreach line $data {
       set x $::StringToFind
       set y $line
      set z [string match x y]
      puts $z
       if [ string match $::StringToFind line ] {
           return 1
       }
  }
  </code></pre>