Sora Posted January 30, 2013 Share Posted January 30, 2013 hi , while i'm using fileWrite , i tried to go to the next line using fileSetPos(file,fileGetPos(file)+110) but it just makes some spaces , how can i go to the next line ? i want to do something like local file = fileCreate("file.txt") fileWrite(file,"first line") goToNextLine(file) fileWrite(file,"second line") fileClose(file) file.txt first line second line Link to comment
Castillo Posted January 30, 2013 Share Posted January 30, 2013 Doesn't "\n" work? local file = fileCreate("file.txt") fileWrite(file,"first line\nsecond line") fileClose(file) Link to comment
Sora Posted January 30, 2013 Author Share Posted January 30, 2013 (edited) Doesn't "\n" work? local file = fileCreate("file.txt") fileWrite(file,"first line\nsecond line") fileClose(file) \n work is new line ? i didn't know that , thanks ^^ Edited January 30, 2013 by Guest Link to comment
Sora Posted January 30, 2013 Author Share Posted January 30, 2013 \n only works with notepad or scite but not with ms-notepad because the file opened using ms-notepad by default and it shows me first linesecond line in notepad++ or scite ( lua editors ) first line second line thanks Solidsnake(castillo) Link to comment
uhm Posted January 30, 2013 Share Posted January 30, 2013 To get it to work in MS Notepad (and anything else), do \r\n instead of just \n 2 Link to comment
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