Jump to content
Sign in to follow this  

Simple filewrite question

Recommended Posts


I'm taking a file, reading it's contents and pulling out the mousemove(x,y). I'm writing this into a file in mouseclick("left",x,y,1,1) format.

How can I have it write the quote marks around LEFT when it writes to the file?

#include <misc.au3>
 #include <file.au3>
 While 1
 Func _Start()
    $count = _FileCountLines("blah.au3")
    for $x = 0 to $count step 1
        $line = FileReadLine("blah.au3",$x)
        $string = StringLen ( $line ) 
        $left = Stringmid($line,10,1)
        $left2 = Stringmid($line,11,7)
        $left3 = Stringmid($line,18,1)
        If $string = 18 Then
            Filewriteline("coors.au3","mouseclick" & $left & "left", $left2,$left3)
 Func _End()

Share this post

Link to post
Share on other sites

To write the quotes you need to wrap them each in an apostrophe. Like this:


Or like this:

'"' & "LEFT" & '"'

Share this post

Link to post
Share on other sites

I had tried "'Left'", but it didn't work. I never thought to try it the other way >.<.

Thank you ^-^

Share this post

Link to post
Share on other sites

You will also find that using _FileReadToArray() is much faster than just using FileReadLine().

Put It in a For/Next loop and use an If NOT StringInStr($array[$I], 'Text You want') Then ContinueLoop

And if the quotation marks are in the line you're reading then StringMid($line, 10, 8) might work. If that misses the closing quote then make it 10, 9


Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver: - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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