compare apache lib-simulate grep -search A.txt lib in B.txt
来源:互联网 发布:qq音乐 for ubuntu 编辑:程序博客网 时间:2024/06/05 19:51
#!/usr/bin/perl -wmy $file=$ARGV[0];my $file1=$ARGV[1];$file2 ="found.txt";$file3 ="nofound.txt";open($fh,'<',$file) or die $!;open($fh1,'<',$file1) or die $!;open($fh2,'>',$file2) or die $!;open($fh3,'>',$file3) or die $!;my @list="";$j=0;while ($line=<$fh>) { if ($line =~ /.*\\(mod.*)/) { $a=$1; ####################################### #consult don;t add \n ,all array list print in one line?????????????? $a=$a."\n"; push (@list ,$a); $j++; #can;t use print @list to print array #foreach(@list) #{ # print "line16:$_\n"; #} }}while ($line1=<$fh1>) { push @list1 ,$line1;}$found=0;$nofound=0;my @found1="";my @nofound1="";$ii=0;print @list;foreach (@list){ $ii++; $a = $_; if ( $a eq "" ) { next; } #success use grep , key is use (),otherwise it don;t get element ,it get all array @f= (grep /$a/, @list1); if (@f) { $found++; push (@found1,$a); print $fh2 $a; } else { #attention print "line27:$a \n"; the space will also been printed. $nofound++; push @nofound1 ,$a; print $fh3 $a; }}my $aa=@found1;my $bb=@nofound1;print "found=$found;nofound=$nofound;$aa;$bb\n";print ("@found1");print ("@nofound1");
阅读全文
0 0
- compare apache lib-simulate grep -search A.txt lib in B.txt
- WebContent/WEB-INF/lib/readme.txt’ in project ‘xxxxxxxxx’ cannot be read or is not a valid ZIP file解
- cat a.txt | grep ">" | wc -l解释
- 复制a.txt到b.txt,并实现数据排序
- lib 对 lib*.a ......
- a.txt,b.txt都是1G大小,要把b.txt复制给a.txt,具体步骤。
- 用两个文件a.txt;b.txt.使用linux命令,复制,a.txt文档倒数第十行的记录to b.txt文档
- 拼接两个顺序文件a.txt和b.txt的内容,结果保存在a.txt(未成功)
- 还在为一个个粘贴lib文件名苦恼么?所有lib文件名写入TXT方法(CMD命令dir)
- 将a.txt文件中的单词与b.txt文件中的单词交替合并到c.txt
- 将a.txt文件中的单词与b.txt文件中的单词交替合并到c.txt
- php 复制a.txt复制到b.txt,a.txt从第2行到10行复制到c.txt
- Ruby mysql lib compare with Python mysql lib
- txt
- TXT
- Java 使用最新POI Lib 将Excel转换成Txt读取Excel内容工具类
- Lib
- lib
- MyBatis学习总结(五)——实现关联表查询
- 安卓开发入门之系统下载管理工具DownloadManager-第二部分(翻译)
- MDK分散加载脚本
- MyBatis学习总结(六)——调用存储过程
- Laravel中数据迁移执行php artisan migrate 报错问题
- compare apache lib-simulate grep -search A.txt lib in B.txt
- MyBatis学习总结(七)——Mybatis缓存
- Java环境简单配置+IDEA(小白版)
- gulp、MockJs、NodeJs、Mustache脱离后台环境,只通过模拟数据运行项目
- MyBatis学习总结(八)——Mybatis3.x与Spring4.x整合
- RabbitMQ 入门 Helloworld
- grep练习题
- 中文文件加密、解密
- librdkafka的安装和使用