Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FINDSTR workaround needed

Featured Replies

I tested the script

Test1.txt

  Operating System	   » Microsoft Windows 7 Ultimate 64-bit
Os Version  » 6.1.7600 Ultimate Edition
Build Type  » Multiprocessor Free
Serial Number  » 00426-292-0106894-85791
Processor Name  » Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz (x64)
Video Card Name  » NVIDIA GeForce 9800 GT
Sound Device Name  » C-Media PCI Audio Device
Network Adapter  » 802.11n Wireless PCI Express Card LAN Adapter
Network Adapter  » Realtek RTL8168C(P)/8111C(P) Family PCI-E Gigabit Ethernet NIC (NDIS 6.20)

Test2.txt

  Computer Name		  » HOME-BETA-2008
Operating System  » Microsoft Windows 7 Ultimate 64-bit
Os Version  » 6.1.7600 Ultimate Edition
Build Type  » Multiprocessor Free
Serial Number  » 00426-292-0106894-85791
Physical Memory  » 8.00 GB
Processor Name  » Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz (x64)
Video Card Name  » NVIDIA GeForce 9800 GT
Sound Device Name  » C-Media PCI Audio Device
Network Adapter  » 802.11n Wireless PCI Express Card LAN Adapter
Network Adapter  » Realtek RTL8168C(P)/8111C(P) Family PCI-E Gigabit Ethernet NIC (NDIS 6.20)
Computer Type   » KQ499AA-A2L m9360f

Differences.txt

  Computer Name		  » HOME-BETA-2008
Physical Memory  » 8.00 GB
Computer Type   » KQ499AA-A2L m9360f

So the scripts looks for what missing in Test1, From Test2, reports it in Differences.txt

 Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim StrTxt1, StrTxt2, StrTxt3, Ts
'-> First Text File
Set Ts = Fso.OpenTextFile("Test1.txt", 1)
StrTxt1 = Ts.ReadAll
Ts.Close
'-> Second Text File
Set Ts = Fso.OpenTextFile("Test2.txt", 1)
Do Until Ts.AtEndOfStream
StrTxt2 = Ts.ReadLine
If InStr(StrTxt1, StrTxt2) = 0 Then
StrTxt3 = StrTxt3 & StrTxt2 & vbCrLf
End If
Loop
Ts.Close
'-> Third Text File
Set Ts = Fso.CreateTextFile("Differences.txt")
Ts.WriteLine StrTxt3
Ts.Close

  • Author

yes you are right, in my attachment i have provided 2 files that dont work properly with the script, i think this is because of common "fragment" issues, something like that, however the bat works properly since its a line by line comparison although takes a year.

anyway its not a huge deal.

thanks again.

Edited by bauxite

The script only looks for what missing from one file, what you want is a script that looks for what missing from both files.

I write up a script that will look for what missing from both files.

1.txt

XYZ
ABC
notreallyuncommon
onlyin1.txtsodontreallymatter1
onlyin1.txtsodontreallymatter2
x
y
astring1
astring2
astring3
D
E
p
o
i
GV
END

2.txt

uncommon
XYZ
uncommonstring2
astring1
astring2
astring3
A
B
uncommonstring3
C
D
E
i
o
p
V
Z
notreallyuncommon
uncommonstring1
END

What missing from both files are stored Differences.txt

ABC
onlyin1.txtsodontreallymatter1
onlyin1.txtsodontreallymatter2
x
y
GV
uncommon
uncommonstring2
A
B
uncommonstring3
C
V
Z
uncommonstring1

Save As Sort2.vbs

 Dim Dic :Set Dic = CreateObject("Scripting.Dictionary")
Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Obj, Ts, Txt1
Set Ts = Fso.OpenTextFile("1.txt", 1)
Do Until Ts.AtEndOfStream
Txt1 = Ts.ReadLine
Dic.Add Txt1 ,Txt1
Loop
Ts.Close
Set Ts = Fso.OpenTextFile("2.txt", 1)
Do Until Ts.AtEndOfStream
Txt1 = Ts.ReadLine
If Not Dic.Exists(Txt1) Then
Dic.Add Txt1 ,Txt1
Else
Dic.Remove Txt1
End If
Loop
Ts.Close
Set Ts = Fso.CreateTextFile("Differences.txt")
For Each Obj In Dic.Keys
Ts.WriteLine Obj
Next
Ts.Close

  • Author

Awesome.

that is quite brilliant, thank you again :)

Your welcome, now the only problem might be in the first loop change

   Do Until Ts.AtEndOfStream
Txt1 = Ts.ReadLine
Dic.Add Txt1 ,Txt1
Loop

Dictionary Objects can not have duplicate objects, so incase 1.txt has say

astring3
astring3

the script would error out because the object exists, this code change prevents that error

   Do Until Ts.AtEndOfStream
Txt1 = Ts.ReadLine
If Not Dic.Exists(Txt1) Then
Dic.Add Txt1 ,Txt1
End If
Loop

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.