-
Notifications
You must be signed in to change notification settings - Fork 3
/
calc.pl
46 lines (43 loc) · 1.04 KB
/
calc.pl
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
#!/usr/bin/perl
$file1=shift @ARGV;
chomp $file1;
open F2,$file1;
$ftr=5;
$rown=0;
while($l=<F2>){
$rule=0;$rulc=0;$rown++;
@t=split(/\s+/,$l);#$len=(@t);
for($c=2;$c<=($ftr*3+1);$c=$c+3){
#print "$c\t@t[$c]\t";
if($l=~/^Rule/ and @t[$c]!~/-/){
if($rulc%1==0){$rule++;}
if($rown%2==0){
$X1=(@t[$c]);
$X2=(@t[$c+2]);
print "$X1\t$X2\t";
}
else{
$X1=(@t[$c]);
$X2=(@t[$c+2]);
print "$X1\t$X2\t";
}
$rulc++;
}
}
print "\n";
}
close F2;
#X1=X2(Max0-MinO)+Min
#Mean1=Mean2(Max0-MinO)+Min
#Std1=Std2(Max0-MinO)
#perl fileform5.pl top4_tr.txt 4 top4_train_n.txt top4m.txt > res4.txt
#
#perl fileform5.pl top5_tr.txt 5 top5_train_n.txt top5.txt > res5.txt
#
#perl fileform5.pl top4_tr.txt 4 top4_train_n.txt top4.txt > res4.txt
#
#perl fileform5.pl top4_tr.txt 4 top4_train_n.txt top4m.txt > res4m.txt
#
#perl fileform5.pl top4_tr.txt 4 top4_train_n.txt top4.txt > res4.txt
#
#perl fileform5.pl top4_tr.txt 4 top4_train_n.txt top4m.txt