perl滑动匹配核心代码

 if ($ansfline eq "\"data\"")
        {
        $dataflag=1;
        next;
      }
     if($dataflag==1)
     {
      
      #以下代码滑动匹配时间
      if($compflag==0)
      {  if ($ansfline<=$result_time1)
          {
            $compflag=1;
            $pre2=tell(ansf1);
           
         
         }
       }
       elsif($compflag==1)
       { 
          if ($ansfline>=$result_time2)
          {
            $compflag=2;
           
         
         }
        #elsif($ansfline<=$result_time1)
        #{
        #   $compflag=1;             
        #}
         else
         {
          #$position_minus=$position-$pre;
            seek(ansf, $pre, 0);   #回退1行
             $position_change = tell(ansf);
            
             #print "position minus 1 is $position_change\n";
             $compflag=0;
         }
        
          
                    
       }
       elsif($compflag==2)
       {
           if($ansfline=~/"\*"/)
           {
            #print "find\n";
            $result_total+=$result_time2-$result_time1;
            print(frecOut "find $resfline in $resFile is not match in $ansFile\n");
           }
           else
           {
            
             #seek(ansf, $pre, 0);
             seek(ansf, $pre2, 0);     #回退两行
             $position_change = tell(ansf);
            
             #print "position minus 2 is $position_change\n";

           }
          
            $compflag=0;
          
          
       }
      
       }
       
      }   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值