closeupman Posted January 20, 2005 Share Posted January 20, 2005 (edited) I'm trying to strip out some values from a file, but the script just seems to pause and not complete. I check for an end of file and exit if there is. But it doesnt seem to...it just pauses. $inputfile="C:\WINNT\Profiles\user\Desktop\Personal\VirtualKeyCodes.au3" $outputfile="C:\WINNT\Profiles\user\Desktop\mykegLOGGGG.txt" $input=fileopen($inputfile,0) $output=fileopen($outputfile,2) while 1 $charread=fileread($input,1) if @error=-1 then Exitloop if $charread="'" Then filewrite($output,$charread) if @error=-1 then Exitloop $charread=fileread($input,1) While $charread <> "'" filewrite($output,$charread) $charread=fileread($input,1) if @error=-1 then Exitloop WEnd filewrite($output,$charread&",") EndIf sleep(100) WEnd FileClose($input) FileClose($output)VirtualKeyCodes.au3 Edited January 20, 2005 by closeupman Link to comment Share on other sites More sharing options...
phillip123adams Posted January 20, 2005 Share Posted January 20, 2005 I'm trying to strip out some values from a file, but the script just seems to pause and not complete. I check for an end of file and exit if there is. But it doesnt seem to...it just pauses.... filewrite($output,$charread) if @error=-1 then Exitloop $charread=fileread($input,1) While $charread <> "'" ...<{POST_SNAPBACK}>My guess is you are missing an @error check after one of the FileRead statements. Perhaps the @error line above it should be below it. Phillip Link to comment Share on other sites More sharing options...
closeupman Posted January 20, 2005 Author Share Posted January 20, 2005 (edited) My guess is you are missing an @error check after one of the FileRead statements. Perhaps the @error line above it should be below it.<{POST_SNAPBACK}>Thanks, but actually it does work!....but took Time: 963.593 seconds!!! (that's why I thought it didnt!)If you see the file above that I strip it isn't that big so I didn't think it would take THAT long. Is there a way to speed up the process?Can someone optimize my script?Thanks Edited January 20, 2005 by closeupman Link to comment Share on other sites More sharing options...
phillip123adams Posted January 20, 2005 Share Posted January 20, 2005 Thanks, but actually it does work!....but took Time: 963.593 seconds!!! (that's why I thought it didnt!)If you see the file above that I strip it isn't that big so I didn't think it would take THAT long. Is there a way to speed up the process?Can someone optimize my script?Thanks <{POST_SNAPBACK}>Oh, remove the sleep(100)! I tested on your file and it only took a couple of seconds after removing the sleep. Phillip Link to comment Share on other sites More sharing options...
closeupman Posted January 20, 2005 Author Share Posted January 20, 2005 Oh, remove the sleep(100)! I tested on your file and it only took a couple of seconds after removing the sleep.<{POST_SNAPBACK}>Ok, thxs....doh! :"> 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