brodie28 Posted July 21, 2006 Author Posted July 21, 2006 (edited) Thanks mate, works perfectly. Sorry for the double post. Edited July 21, 2006 by brodie28
Moderators SmOke_N Posted July 21, 2006 Moderators Posted July 21, 2006 Could that be changed so that it does not delete lines that are only spaces? I added a StringIsSpace if statement but it didn't work.Have you ever seen a StringIsSpace statement before? I haven't ...#include <File.au3> Local $sFilePath = @ScriptDir & '\locals.txt' Local $nArray = '', $sStore If Not _FileReadToArray($sFilePath, $nArray) Then MsgBox(64, 'Info:', 'Error reading File') For $iCount = 1 To UBound($nArray) - 1 If StringInStr($nArray[$iCount], 'Civilian') Or _ StringInStr($nArray[$iCount], 'Thug') Or _ StringStripWS($nArray[$iCount], 8) = '' Then $sStore &= $nArray[$iCount] & @CRLF EndIf Next $hOpen = FileOpen($sFilePath, 2) FileWrite($hOpen, $sStore) FileClose($hOpen) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
jvanegmond Posted July 21, 2006 Posted July 21, 2006 If you run a string that contains only " " (whitespaces) this may work:StringRegExp($StringToCheck," *") Untested. github.com/jvanegmond
MHz Posted July 21, 2006 Posted July 21, 2006 If you run a string that contains only " " (whitespaces) this may work:StringRegExp($StringToCheck," *") Untested.Read up on white space. Carriage Returns, Line Feeds, Horizontal Tabs, Vertical Tabs....
jvanegmond Posted July 21, 2006 Posted July 21, 2006 (edited) I just did, lol. It's worth a shot. Edit: Whitespace isn't cr, lf, or tabs.. from memory, \S is useless. Edited July 21, 2006 by Manadar github.com/jvanegmond
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