Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Compare each line in text. Stringsplit/stringinstr

$
0
0
Two .txt files:
Exmaple of first txt
424242424242:text
3423434322311:text
2133245345344:text
5443322134566:text
65432345322344:text
And so on


Second txt:
user:65432345422344:email:address
user:424242424242:emailt:address
user:43324567534:email:address
And so on


So what I want is to find these code dublicates and from 2 lines make only 1 in new txt. For example firstly I check 424242424242:text  and compare few hundrets of other file lines till I find 424242424242. When I find output in new txt should be 424242424242:text  |empty space or any symbol|   user:424242424242:emailt:address. Better would be without that code. And if same code wasnt found then go for 3423434322311:text ....

What I already tried.


[ autoit ]      
#include <FileConstants.au3> #include <array.au3> Global $hashpw1 = FileOpen("txtfile1.txt", 0) global $hasemail1 = FileOpen("txtfile2.txt", 0) Global $hOutPutFile = FileOpen("output.txt", $FO_OVERWRITE) While 1 $hashpw = FileReadLine($hashpw1) For $i = 1 to 6000 ;Im not sure for this loop. I need to check ALL lines so maybe I should use _FileCountLines() ? $hasemail = FileReadLine($hasemail1) $aSplit1 = StringSplit($hasemail, ":") If StringInStr(StringMid($hashpw,1,32),$aSplit1) Then MsgBox(0,"","found?") FileWriteLine($hOutPutFile,$hashpw&" "&$hasemail) EndIf Next WEnd FileClose($hashpw1) FileClose($hasemail1) FileClose($hOutPutFile)

BRAINPAIN!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>