[英]comparing two text files' contents using PowerShell
I am having two text files having comma separated data.I want to compare and find out the difference between these two files' content. 我有两个带有逗号分隔数据的文本文件。我想比较并找出这两个文件的内容之间的区别。 How to do this with using PowerShell.
如何使用PowerShell执行此操作。 I am getting the rows count as per below code:
我正在按以下代码计数行数:
$rows = Get-Content "D:\FCA\FCA_node_final.txt"
$rows.count
$rows = Get-Content "D:\FCA\FCA.txt"
$rows.count
here am getting the count 358 and 379 i want to get the remaining 21 rows. 这里得到的计数358和379我想得到其余的21行。 here is the format of file :
这是文件的格式:
Pre-Validation/MIS,MIS,MIS 预验证/ MIS,MIS,MIS
Pre-Validation/MIS/Reports,Reports,Reports 预验证/ MIS /报表,报告,报表
Pre-Validation/PBGSBLC,PBGSBLC,PBG/SBLC 预验证/ PBGSBLC,PBGSBLC,PBG /备用信用证
/PBGSBLC/SBLCBGdetails,SBLCBGdetails,SBLC/BG details / PBGSBLC / SBLCBG详细信息,SBLCBG详细信息,SBLC / BG详细信息
您可以使用Compare-Object cmdlet :
Compare-Object -referenceobject $(get-content "D:\FCA\FCA_node_final.txt") -differenceobject $(get-content "D:\FCA\FCA.txt")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.