in each of these folders is a text file called file.txt
Each of these text files will have a line or lines (unknown) containing the string “RealValue=X”
The value of X can be any random number.
The relevance I’m going for is this:
every line with “RealValue=” in C:\folder2\file.txt and C:\folder3\file.txt should also exist in C:\folder1\file.txt. If not, the relevance returns false.
I have this to return the lines containing “RealValue=”
(lines whose (it contains “RealValue=”) of file “C:\folder2\file.txt”)
(lines whose (it contains “RealValue=”) of file “C:\folder3\file.txt”)
But i’m not sure how i should go about comparing these to C:\folder1\file.txt.
This sounds like a job for tuples. Here is a simplistic example:
Q: (item 0 of it = item 1 of it) of (“A”, “B”)
A: False
Q: (item 0 of it = item 1 of it) of (“A”, “A”)
A: True
Now lets check item 0 compared against two other items:
Q: (item 0 of it = item 1 of it AND item 0 of it = item 2 of it) of (“A”, “A”, “B”)
A: False
Q: (item 0 of it = item 1 of it AND item 0 of it = item 2 of it) of (“B”, “A”, “A”)
A: False
Q: (item 0 of it = item 1 of it AND item 0 of it = item 2 of it) of (“A”, “B”, “C”)
A: False
Q: (item 0 of it = item 1 of it AND item 0 of it = item 2 of it) of (“A”, “A”, “A”)
A: True
Now, you can plug in lines of files:
Q: (item 0 of it = item 1 of it AND item 0 of it = item 2 of it) of ((lines whose (it contains “RealValue=”) of file “c:\folder1\file.txt”), (lines whose (it contains “RealValue=”) of file “c:\folder2\file.txt”), (lines whose (it contains “RealValue=”) of file “c:\folder3\file.txt”))
If there are mis-matching numbers of lines that contain “RealValue” you will get a result of false, but I believe that is what you want.
Ha! Yeah… sorry, the relevance I provided is completely wrong for your use case… not quite sure how to fix that. Perhaps Ben or Jesse (et al.) can point us in the right direction.
If there is no “clever” way to fix it I fear that there might be a combinatorial explosion of code (just doing a brute force check). To that end, how many “RealValues” do you have per file?