#!/bin/sh # # this script converts the result from mdltest to a MS EXCEL readable formated spreed sheet # # The next line is executed by /bin/sh, but not Tcl \ exec tclsh $0 ${1+"$@"} if {$argc != 1} { error "Usage: test2xl filename" } set sourfile [open [lindex $argv 0] r] set dir $env(PWD) # set result [open toot r] set p " " while {[ gets $sourfile line ] >= 0 } { if [regexp {GRILLES-BOOLEAN ([a-zA-Z0-9]*) ([a-zA-Z][0-9]) : ([\ ]*) ([a-zA-Z]*)} $line dummy EDCnb AZnb dummy1 oko] { if {$AZnb == "A1"} { # close $result set file $EDCnb append file ".txt" set result [open $file w] puts ":: $EDCnb" puts $result ":: $EDCnb" puts ": 1 commun : 2 fusion : 3 coupe 1 par 2 : 4 coupe 2 par 1 " puts $result ": 1 commun : 2 fusion : 3 coupe 1 par 2 : 4 coupe 2 par 1 " } append p $oko append p ":" if {$oko != "OK"} { set oko "KO" } if {[string index $AZnb 1 ] == "1"} { set OK $AZnb append OK ":" append OK $oko append OK ":" } elseif {[string index $AZnb 1 ] == "2"} { append OK $oko append OK ":" } elseif {[string index $AZnb 1 ] == "3"} { append OK $oko append OK ":" } elseif {[string index $AZnb 1 ] == "4"} { puts "" puts $p set p " " append OK $oko puts $OK puts $result $OK } else { puts "error letter" } } }