Scorpys Posted December 13, 2021 Share Posted December 13, 2021 So I have this code. It pulls text from a txt file, removes the characters that I want removed, and then pastes the result somewhere: Local $MyFileLocation = @ScriptDir & "\my.txt" Local $FuckedUpString = FileRead($MyFileLocation) Sleep(1000) Local $FuckedUp2 = $FuckedUpString Local $Cleaner Local $Removal[6] $Removal[0] = "-" $Removal[1] = "_" $Removal[2] = "." $Removal[3] = "," $Removal[4] = " " $Removal[5] = "|" For $i = 0 To UBound($Removal) - 1 $Cleaner = StringReplace($FuckedUp2,$Removal[$i],"") $FuckedUp2 = $Cleaner Next Sleep(250) MouseClick("left",1500,246) Sleep(250) MouseClick("left",738,462) Sleep(250) Send($Cleaner, 1) I think this code is very beautiful and easy to understand, anyone can use it What I would like to add to this is, if the result that needs to be pasted (after cleanup) is 4 characters or less, or 7 characters or more, then remove everything, don't paste anything. I'm coming up empty when searching. Not sure how complicated this would be to implement. If anyone can help I'd appreciate it. Thanks Link to comment Share on other sites More sharing options...
mikell Posted December 13, 2021 Share Posted December 13, 2021 3 hours ago, Scorpys said: I'm coming up empty when searching. Oh. A little more and you found StringLen Link to comment Share on other sites More sharing options...
Scorpys Posted December 13, 2021 Author Share Posted December 13, 2021 Yeah, that was the solution 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