title: Working with file containing unmatched braces
body: <p>I need to modify a file containing several lines with unmatched braces like:</p>
  
  <pre><code>  rmsd {
      atoms {
        atomsFile 
        atomsCol B
        atomsColValue 1
      }
  </code></pre>
  
  <p>So if I do this:</p>
  
  <pre><code>set fp [open "fpor.conf" r]
  set file_data [read $fp]
  close $fp
  set confFile [split $file_data "\n"]
  
  set inOut [open "us.in" w]
  
  foreach line $inFile {
       if {[lindex $line 0] == "atomsFile"} {
          lappend line "us.pdb"
       }
       puts $inOut "$line"
  }
  close $inOut
  </code></pre>
  
  <p>The script fails with the error:
  unmatched open brace in list. Is there a way to avoid this? </p>