maniootek Posted February 15, 2010 Posted February 15, 2010 File 'test.txt' contains few lines of text, like here: Line1 Line2 Line3 and when I run this code: $file = FileOpen("test.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "Something") FileClose($file) my file would now looks like that: Line1 Line2 Line3Something Now, how to erase all lines in that text file and put this "Something" text to ONLY line 1 after run this code it should looks like that: "Something" (only 1 line)
whim Posted February 15, 2010 Posted February 15, 2010 in FileOpen, use flag 2 to overwrite: FileOpen("test.txt", 2) whim
maniootek Posted February 15, 2010 Author Posted February 15, 2010 Can't belive that I missed it. Thanks !
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