AvidLearner 0 Posted May 25, 2010 Guys I'm tryin' to write a new line using FileWrite() command to a text file.. Help me please... Thanks... Share this post Link to post Share on other sites
Jos 2,208 Posted May 25, 2010 What seems to be the problem when you tried? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
AvidLearner 0 Posted May 25, 2010 What seems to be the problem when you tried?I tried Filewrite($file,"{enter}")But when I open the $file,, I dont see a new line but get {enter} as text data.. Share this post Link to post Share on other sites
Affe 1 Posted May 25, 2010 (edited) If you use Chr(10) instead of {enter}, it should work. Filewrite($file,Chr(10)) Chr() allows you to send ascii characters, and 10 is the ascii for a line feed. Interesting note: We both joined the same year, almost 2 months apart, and have the same number of posts at this time Edited May 25, 2010 by Affe [center][/center] Share this post Link to post Share on other sites
Jos 2,208 Posted May 25, 2010 I tried Filewrite($file,"{enter}")But when I open the $file,, I dont see a new line but get {enter} as text data..Filewrite($file,@crlf)-or-Filewriteline($file,"") 1 JordyMeng reacted to this SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
AvidLearner 0 Posted May 25, 2010 (edited) If you use Chr(10) instead of {enter}, it should work. Filewrite($file,Chr(10)) Chr() allows you to send ascii characters, and 10 is the ascii for a line feed. Interesting note: We both joined the same year, almost 2 months apart, and have the same number of posts at this time Tats cool Thanks fr the support,,, but FileWrite($sFile,Chr(10)) dint work fr me... Edited May 25, 2010 by AvidLearner Share this post Link to post Share on other sites
Affe 1 Posted May 25, 2010 Thanks fr the support,,, but FileWrite($sFile,Chr(10)) dint work fr me... Use Jos' example. Didn't think of a simple @CRLF. FileWrite($sFile,@CRLF) [center][/center] Share this post Link to post Share on other sites
Jos 2,208 Posted May 25, 2010 Tats cool Thanks fr the support,,, but FileWrite($sFile,Chr(10))dint work fr me...this is not really the standard for Windows files as they use CR+LF..... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
AvidLearner 0 Posted May 25, 2010 Filewrite($file,@crlf)-or-Filewriteline($file,"")Thank you Jos..I got it nw... Share this post Link to post Share on other sites
AvidLearner 0 Posted May 25, 2010 Use Jos' example. Didn't think of a simple @CRLF. FileWrite($sFile,@CRLF) Thank you... Share this post Link to post Share on other sites
wolf9228 65 Posted May 25, 2010 $file = FileOpen("test.txt", 2) FileWrite($file, "Line1") FileWrite($file, "Still Line1" & @CRLF) FileWrite($file, "Line2") FileClose($file) OR $CRLF = Chr(13) & Chr(10) $file = FileOpen("test2.txt", 2) FileWrite($file, "Line1") FileWrite($file, "Still Line1" & $CRLF) FileWrite($file, "Line2") FileClose($file) صرح السماء كان هنا Share this post Link to post Share on other sites