Sign in to follow this  
Followers 0
face

remove bad words from txt file word list

11 posts in this topic

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

Share this post


Link to post
Share on other sites



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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

its 2 text files with 1 column each one of them has 200k+ rows the other around 400+ (bad words)

any ideas?

Edited by face

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

thank you

can anyone post an example plz

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

any help

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0