- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2013-09-10 18:39 编辑
回复 10# bmechuangye
...
A 17 0.292
A 18 0.309 <== case1
...
A 30 0.521
A 31 0.232 <== case 1
...
A 60 0.885
B 0 0.000449 <== case 2
case 1, big/small is changed
A 17 0.292 <== last time {N=$1;e=$2;r=x}
A 18 0.309 <== current
Now(current)...
N="A" , e=17, r="small"
$1="A", $2=18, x="big"
check condition: $1!=N||$2-e!=1||x!=r{if(N)print N,s,e,r;s=$2}
x!=r will be true ("big" is not the same "small")
and output the information, and reset the start(s) from $2(18)
A 0 17 small <== output information
Case 2: N is changed
A 60 0.885
B 0 0.000449 <== current
Now(current)...
N="A" , e=60, r="big"
$1="B", $2=0, x="small"
check condition: $1!=N||$2-e!=1||x!=r{if(N)print N,s,e,r;s=$2}
$1!=N will be true ("A" is not the same "B")
and output the information, and reset the start(s) from $2(0)
A 53 60 big <== output information
Case3: the $2 is not consecutive number with last time
Note: There is no this case in your data
for example:
A 17 0.292
A 20 0.209 <== it is not consecutive number from 17 to 20
check condition: $1!=N||$2-e!=1||x!=r{if(N)print N,s,e,r;s=$2}
$2-e!=1 will be true (it is not consecutive number from 17 to 20)
|
|