zoukankan      html  css  js  c++  java
  • perl 处理文本

    redis01:/root# cat abc
    GET /api/sale/get_voucher_list?loupan_id=32300&suid=kJIjl&loupan_site=sc&code=d30d52a87c0ba4e342c9315d44845be5&source=pc HTTP/1.1
    GET /api/sale/get_voucher_list?loupan_id=108578&loupan_site=huizhou&code=26f3cdc956828768a54c334eb76770f5&source=pc HTTP/1.1
    GET /api/sale/get_voucher_list?loupan_id=107499&loupan_site=dg&code=e22b6dd312cd2921adc0788578345615&source=pc HTTP/1.1
    GET /api/sale/get_voucher_list?loupan_id=103399&loupan_site=nb&code=ccc411746f3505ea8fe5ecef6b2657ce&source=pc HTTP/1.1
    POST /api/sale/get_voucher_list?loupan_id=103399&loupan_site=nb&code=ccc411746f3505ea8fe5ecef6b2657ce&source=pc HTTP/1.1
    GET /index.php/Site/Index/room_id/1206?wt_source=newshp_twzb_05 HTTP/1.1
    GET /rss/detail/jinri/6154165177643499905.html?source=jrtt HTTP/1.1
    GET /rss/detail/jinri/6153808754283709277.html?source=jrtt HTTP/1.1
    GET /rss/detail/jinri/6154162659391767265.html?source=jrtt HTTP/1.1
    GET /sso/cookies.php?callback=_1467350571428134&uid=140812417 HTTP/1.1
    GET /sso/cookies.php?callback=_1467350571421134&uid=140812117 HTTP/1.1
    GET /sso/cookies.php?callback=_14673505734551134&uid=141234522117 HTTP/1.1
    GET /sso/cookies.php?callback=_146711135411428134&uid=14112322117 HTTP/1.1
    GET /index.php/Site/Index/room_id/1116?wt_source=newshp_twzb_05&max=123 HTTP/1.1
    GET /index.php/Site/Index/room_id/1356?wt_source=newshp_twzb_03 HTTP/1.1
    redis01:/root# perl a1.pl 
    GET /rss/detail/jinri/6154162659391767265.html?source=jrtt HTTP/1.1
    GET /index.php/Site/Index/room_id/1356?wt_source=newshp_twzb_03 HTTP/1.1
    GET /index.php/Site/Index/room_id/1206?wt_source=newshp_twzb_05 HTTP/1.1
    GET /rss/detail/jinri/6154165177643499905.html?source=jrtt HTTP/1.1
    POST /api/sale/get_voucher_list?loupan_id=103399&loupan_site=nb&code=ccc411746f3505ea8fe5ecef6b2657ce&source=pc HTTP/1.1
    GET /rss/detail/jinri/6153808754283709277.html?source=jrtt HTTP/1.1
    GET /sso/cookies.php?callback=_146711135411428134&uid=14112322117 HTTP/1.1
    GET /index.php/Site/Index/room_id/1116?wt_source=newshp_twzb_05&max=123 HTTP/1.1
    redis01:/root# cat a1.pl 
              open (LOG ,"<","abc");  
                  while (<LOG>) {  
                            chomp; 
                            if ($_ =~ /s*(POST|GET)s+(.*?)?.*/){
                            $hash{$2}=$_;
                            };
                          }; 
            while(my($a, $b) = each %hash) 
                   {
                     print $b."
    ";
                     };

  • 相关阅读:
    B-tree/B+tree/B*tree
    java拆装箱(转)
    C语言身份证信息查询系统(修改版)
    UC编程:字符读取与行读取
    UC编程:通过fwrite()和write()比较标准库函数和系统调用的速度
    UC编程:输入输出重定向(系统调用)
    UC编程:输入输出重定向(标准IO)
    UC编程:环境变量的查询与修改
    Perl基础(1)chop与chomp的区别
    假期“实习”20天生存实录
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199587.html
Copyright © 2011-2022 走看看