title: How to convert a file to a tcl list?
body: <p>I have a file named time.dat and acc.dat both of which contains a single column containing numerical values.
  I want to create lists from these files which contain the values in the files. Anyone knows how to do it? </p>
  
  <pre><code>proc ReadRecord {inFilename outFilenameT outFilenameS} {
  
     if [catch {open $inFilename r} inFileID] {
        puts stderr "Cannot open $inFilename for reading"
     } else {
        set outFileIDS [open $outFilenameS w]
        set outFileIDT [open $outFilenameT w]
        foreach line [split [read $inFileID] \n] {
  
           if {[llength $line] == 0} {
              continue
           } else {
              puts $outFileIDT [lindex $line 0]
              puts $outFileIDS [lindex $line 1]
           } 
        }
        close $outFileIDT
        close $outFileIDS
        close $inFileID
     }
  };
  </code></pre>