gpt4 book ai didi

Powershell 比较文本文件并显示差异

转载 作者:行者123 更新时间:2023-12-03 06:55:44 24 4
gpt4 key购买 nike

我需要进行文件比较并想使用 Powershell。我需要一个列出所有差异的输出文件。下面是一个好的开始,但我需要文件包含行号,并且生成的输入对象当前也会在 89 个字符后被截断 - 我需要显示整行:

compare-object (get-content $File1) (get-content $File2) | Out-File $Location

最佳答案

输入对象被默认显示截断。要将整行保存到文件中:

compare-object (get-content $File1) (get-content $File2) | format-list | Out-File $Location

关于Powershell 比较文本文件并显示差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19402629/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com