希望处理后得到b.txt:复制代码
- aaa
- aaa
- bbb
- aaa
- bbb
- bbb
- bbb
- ccc
- bbb
复制代码
- aaa
- bbb
- aaa
- bbb
- ccc
- bbb
复制代码
- open READ,"<a.txt" or die "file not exist $!";
- open WRITE,">b.txt";
- $ever="";
- foreach (<READ>) {
- if ($_ ne $ever) {print WRITE;}
- $ever=$_;
- }
- <STDIN>;
- close READ;
- close WRITE;
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |