WhiteHatBox
Share Page
Following(0)
Partner(s)
kabone76

Comparing two text files and save difference

ReplyThanks 2015/08/25 07:18:32 0 0

Is there a way to compare two text files?


For instance if I have one text file for urls to visit and another for urls already visited , is there a way to compare if the first file has urls from the second list, and if so scrub that list to a new text file?


Example:

urls_visited.txt contains:

url1.com

url2.com

url3.com


and


Urls_not_vitisted.txt contains:

url1.com

url5.com

url4.com


Result Needed: (Scrubbed)

Urls_To_Follow.txt contains:

url5.com

url4.com




Fuck BotChief! WhiteHatBox willl steal from you, disable your keys when they don't get their way
Karmagedon
2015/08/25 13:56:52

I wrote my example:

Compare2Files

When you start you need to specify the path to the two files (urls_visited.txt and Urls_not_vitisted.txt) in the format of "path/file.txt"

After completion of work, you can use the values in the table variable Urls_to_follow to continue the code. Or keep the table values to a file using Good End - Return Variable.

I do not understand how to keep the entire table with the Write File because there is no way to save the entire table. You can save only a certain line.

Module Development - [email protected] // Thanks - https://ko-fi.com/arbots
kabone76
2015/08/25 15:21:39
To save multiple lines you just need to destroy the old variable after writing it, then store the next row, then delete it. Basicly a loop. I will take a look at the project you send and see if i can get it working from that. I managed to figured something out early but its too much and I would need to replace it eventually.
Fuck BotChief! WhiteHatBox willl steal from you, disable your keys when they don't get their way
Karmagedon
2015/08/25 15:47:44

You can simply save each checked line using Write File - Wrap And Append.

But I prefer to add the results to the table - you're all the same will to use them in the module.

Module Development - [email protected] // Thanks - https://ko-fi.com/arbots
zhoucongcq
2015/08/26 04:00:58
1 # kabone76 8/25/2015 7:18:32 AM

Is there a way to compare two text files?


For instance if I have one text file for urls to visit and another for urls already visited , is there a way to compare if the first file has urls from the second list, and if so scrub that list to a new text file?


Example:

urls_visited.txt contains:

url1.com

url2.com

url3.com


and


Urls_not_vitisted.txt contains:

url1.com

url5.com

url4.com


Result Needed: (Scrubbed)

Urls_To_Follow.txt contains:

url5.com

url4.com




This may be added in futher update.
kabone76
2015/08/26 05:16:55
Tri Compare Module
Fuck BotChief! WhiteHatBox willl steal from you, disable your keys when they don't get their way
WhiteHatBox
2015/08/30 00:14:26
kabone76 and Karmagedon , you guys are talent :)
Let's ROCK!
<< < 1> >>
VerifyCode
Advanced Option