summaryrefslogtreecommitdiff
path: root/src/DrawResources/test2xl
blob: 79b8ee250e329831068e7b395a7ebb5fa5ec0d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/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"
	    }
  }
}