Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Compare the Contents of Two Text FilesContent of Compare the Contents of Two Text Files.vbsMD5 Hash: 1052A11C4F48763278E0CB62DE79163D |
||
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile1 = objFSO.OpenTextFile("C:\Scripts\Current.txt", ForReading) strCurrentDevices = objFile1.ReadAll objFile1.Close Set objFile2 = objFSO.OpenTextFile("C:\Scripts\Addresses.txt", ForReading) Do Until objFile2.AtEndOfStream strAddress = objFile2.ReadLine If InStr(strCurrentDevices, strAddress) = 0 Then strNotCurrent = strNotCurrent & strAddress & vbCrLf End If Loop objFile2.Close Wscript.Echo "Addresses without current devices: " & vbCrLf & strNotCurrent Set objFile3 = objFSO.CreateTextFile("C:\Scripts\Differences.txt") objFile3.WriteLine strNotCurrent objFile3.Close | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |