face Posted October 10, 2013 Share Posted October 10, 2013 i have a list of bad words in .txt format and a list of spell check words in .txt format also how can i remove through the bad words list .txt file words from a 200k spell check .txt file Link to comment Share on other sites More sharing options...
JohnOne Posted October 10, 2013 Share Posted October 10, 2013 Many ways. All depends how the lists are formatted. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
UEZ Posted October 10, 2013 Share Posted October 10, 2013 Load the file, find each bad words which you have loaded to an array and replace it with whatever you want.Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Valuater Posted October 10, 2013 Share Posted October 10, 2013 Maybe... Global $text1 = "C:\list.doc" ; your list location here Global $text2 = "C:\spellcheck.doc" ; your spell check location here $list = FileRead($text1) $list = StringSplit($list, ",") ; for comma delimited text file For $x = 1 To $list[0] - 1 If StringInStr($list[$x], $text2) Then MsgBox(0, "Found", $list[$x]) ; do something else here? EndIf Next NOT TESTED 8) Link to comment Share on other sites More sharing options...
face Posted October 10, 2013 Author Share Posted October 10, 2013 (edited) its 2 text files with 1 column each one of them has 200k+ rows the other around 400+ (bad words) any ideas? Edited October 10, 2013 by face Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 10, 2013 Share Posted October 10, 2013 (edited) 200 ... thousand? Oy ... ok, look up FileOpen() FileReadLine() While/WEnd and For/Next Edit: Also, I'd write the results to a new file with FileWriteLine() Sure ... it's not going to win any awards for speed, but it'll brute-force the job. Edited October 10, 2013 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
face Posted October 10, 2013 Author Share Posted October 10, 2013 thank you can anyone post an example plz Link to comment Share on other sites More sharing options...
ripdad Posted October 10, 2013 Share Posted October 10, 2013 ; 2013-10-10_161603 ; blanket sanitizer Local $str, $sFile = @ScriptDir & '\test.txt' If FileExists($sFile) Then $str = FileRead($sFile) $str = StringRegExpReplace($str, '(?is)( word1 )|( word2 )|( word3 )', ' ### ') FileWrite(@ScriptDir & '\test_result.txt', $str) EndIf "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
JohnOne Posted October 10, 2013 Share Posted October 10, 2013 What you really ought to be doing is looking into using a database. 200,000 lines is probably not what .txt files were designed for. The comment about speed from Blue_Drache is an understatement to say the least. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
face Posted October 11, 2013 Author Share Posted October 11, 2013 any help Link to comment Share on other sites More sharing options...
jdelaney Posted October 11, 2013 Share Posted October 11, 2013 (edited) Use ripdad's regexp. If there are not leading and trailing spaces separating the words, then use word boundaries wrapping the 'curse' words instead. Lookup stringregexp in the helpfile. He already provided the example. You can loop through the curse words list, and combine them in the format that ripdad provided, to dynamically create the regexp. I've already shown you similar string concats, and loops before. Edited October 11, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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