Sign in to follow this  
Followers 0
AvidLearner

how to write a new line to a text file..??

11 posts in this topic

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



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

#4 ·  Posted (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 :mellow:

Edited by Affe

[center][/center]

Share this post


Link to post
Share on other sites

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,"")


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 :P

Tats cool :mellow:

Thanks fr the support,,, but

FileWrite($sFile,Chr(10))

dint work fr me...

Edited by AvidLearner

Share this post


Link to post
Share on other sites

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

Tats cool :mellow:

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.....

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Filewrite($file,@crlf)

-or-

Filewriteline($file,"")

Thank you Jos..

I got it nw... :mellow:

Share this post


Link to post
Share on other sites

Use Jos' example. Didn't think of a simple @CRLF.

FileWrite($sFile,@CRLF)

Thank you... :mellow:

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  
Followers 0