couldn't open "ecgreen.res": no such file or directory
    while executing
"open $fichier r"
    ("foreach" body line 3)
    invoked from within
"foreach fichier { "ecgreen.res" "eccoral.res" "ecdim_gray.res" "ecwhite.res" "ecyellow.res"} {
    set leslignes {}
    set f [open $fichier r]
    
 ..."
    (in namespace eval "::request" script line 5)
    invoked from within
"namespace eval ::request $script"
    ("::try" body line 12)

OUTPUT BUFFER:

#!/usr/local/bin/tclsh set fic [open "pcacol.res" w] foreach fichier { "ecgreen.res" "eccoral.res" "ecdim_gray.res" "ecwhite.res" "ecyellow.res"} { set leslignes {} set f [open $fichier r] while {[gets $f Ligne]>=0} { lappend leslignes $Ligne } close $f set col [string range $fichier 2 [expr [string length $fichier] -5]] set aecrire ".coli new -name ca$col -sel rnum=" foreach ligne $leslignes { set ligne [string trim $ligne] set idx [string last " " $ligne] set tmp [string range $ligne 0 [expr $idx-1]] set idx [string last " " $tmp] set chn [string range $tmp [expr $idx+1] [expr $idx+1]] puts "tmp $tmp idx $idx chn $chn" if {$chn >= "A" && $chn <= "Z"} { set num [string range $tmp [expr $idx+2] end] } else { set num [string range $tmp [expr $idx+1] end] } append aecrire $num append aecrire {,} if {[string length $aecrire] >= 60} { append aecrire \\ puts $fic $aecrire set aecrire "" } } if {[string range $aecrire end end] == ","} { set aecrire [string replace $aecrire end end] } append aecrire { and aname=CA} puts $fic "$aecrire" } close $fic exit