比较2个文本文件 [英] comparison of 2 text files

查看:71
本文介绍了比较2个文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文本文件。如何使用perl进行比较?


-Tilu

I have two text files. How do I compare using perl?

-Tilu

推荐答案

这取决于。你想以什么方式比较它们。


- 米勒
That depends. In what way do you want to compare them.

- Miller





如果您正在unix环境中运行脚本,然后更好地使用diff命令。


`diff file1 file2> output.txt`
Hi,

If you are running your script in a unix environment, then better use the diff command.

`diff file1 file2 > output.txt`



这取决于。你想以什么方式比较它们。


- 米勒
That depends. In what way do you want to compare them.

- Miller



我想写一个perl脚本来比较一行按行排列两个文本文件。

I want to write a perl script to compare line by line the two text files.


这篇关于比较2个文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆