brodie28 Posted July 21, 2006 Author Share Posted July 21, 2006 (edited) Thanks mate, works perfectly. Sorry for the double post. Edited July 21, 2006 by brodie28 Link to comment Share on other sites More sharing options...
brodie28 Posted July 21, 2006 Author Share Posted July 21, 2006 Thanks mate, works perfectly. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 21, 2006 Moderators Share 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. Link to comment Share on other sites More sharing options...
jvanegmond Posted July 21, 2006 Share Posted July 21, 2006 If you run a string that contains only " " (whitespaces) this may work:StringRegExp($StringToCheck," *") Untested. github.com/jvanegmond Link to comment Share on other sites More sharing options...
MHz Posted July 21, 2006 Share 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.... Link to comment Share on other sites More sharing options...
jvanegmond Posted July 21, 2006 Share 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 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