Delta Posted June 15, 2007 Share Posted June 15, 2007 I was hoping someone could help me i have two LARGE files each is a list of about 10000 blacklisted sites. I want to combine this list but i don't want to make duplicate entries. Is it possible to compare each list in an autoit script and have it pull out the duplicate entries? or is there an easier way to remove them? [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Das Ami Posted June 15, 2007 Share Posted June 15, 2007 Read the files into 2 arrays and if-loop them, that's the only idea I have right now. Link to comment Share on other sites More sharing options...
Vindicator209 Posted June 15, 2007 Share Posted June 15, 2007 Somewhere along the lines of $line=1 Do $file1 = FileReadLine("file1.txt",$line) $file2 = FileReadLine("file2.txt",$line) $line = $line + 1 If $file1 = $file2 Then FileWriteLine("NewFile.txt",$file1) Else FileWriteLine("NewFile.txt",$file1) FileWriteLine("NewFile.txt",$file2) EndIf Until <===Some State Here Then you can choose to delete the first 2 files.. havent tested that yet, but its something along those lines [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Delta Posted June 15, 2007 Author Share Posted June 15, 2007 (edited) That wouldn't work because its only comparing the same line with each text file and both text files aren't in the same order. Also i just found out there are comments in the second file. They look like this: [some comment here]. How would i mass remove the comments? Edited June 15, 2007 by Deltaforce229 [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Das Ami Posted June 15, 2007 Share Posted June 15, 2007 That wouldn't work because its only comparing the same line with each text file and both text files aren't in the same order. Also i just found out there are comments in the second file. They look like this: [some comment here]. How would i mass remove the comments? Stringinstr and Stringreplace. http://www.autoitscript.com/forum/index.ph...ite=%2Bcomments Link to comment Share on other sites More sharing options...
Delta Posted June 15, 2007 Author Share Posted June 15, 2007 Stringinstr and Stringreplace.http://www.autoitscript.com/forum/index.ph...ite=%2BcommentsDid you even look at that link? all those topic have to do with comments in autoit I.E. #cs, #ce, ; [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Developers Jos Posted June 15, 2007 Developers Share Posted June 15, 2007 One time job? Download PSPad editor, copy the 2 files into one and do option Edit/Sort and tick remove duplicates... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Delta Posted June 15, 2007 Author Share Posted June 15, 2007 JdeB you rule! *bows before the almighty JdeB* [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now