Commit | Line | Data |
---|---|---|
b7b0844d FT |
1 | #!/usr/bin/perl -w |
2 | ||
3 | while(<>) { | |
4 | if(/^(\d+)\s+([\d.]+)(-([\d.]+))?$/) { | |
5 | if(defined($4)) { | |
6 | $temp{$1} = ($2 + $4) / 2; | |
7 | } else { | |
8 | $temp{$1} = $2; | |
9 | } | |
10 | } | |
11 | } | |
12 | ||
13 | print "#name: ct\n"; | |
14 | print "#type: matrix\n"; | |
15 | print "#rows: 1\n"; | |
16 | print ("#columns: " . scalar(keys %temp) . "\n"); | |
17 | for $k (sort keys %temp) { | |
18 | print " $k"; | |
19 | } | |
20 | print "\n"; | |
21 | ||
22 | print "#name: cd\n"; | |
23 | print "#type: matrix\n"; | |
24 | print "#rows: 1\n"; | |
25 | print ("#columns: " . scalar(keys %temp) . "\n"); | |
26 | for $k (sort keys %temp) { | |
27 | print " $temp{$k}"; | |
28 | } | |
29 | print "\n"; |