Sign in to follow this  
Followers 0
nounourson

Character Encoding

6 posts in this topic

#1 ·  Posted (edited)

Hello all,

With a loop, I write several lines in a txt file.

For each step of my loop, I'd like the lines to be one over the other, like :

Line 1

Line 2

Line 3...

But, when I use @CR or Char(13), I just have 1 line with sentences separated with a kind of empty rectangle, like

Line 1[]Line2[]Line3...

I'm pretty sure it's a problem of character encoding.

Could someone help me ?

I've read the help file, but found nothing.

Thx in advance :)

Edited by nounourson

Share this post


Link to post
Share on other sites



Hello all,

With a loop, I write several lines in a txt file.

For each step of my loop, I'd like the lines to be one over the other, like :

Line 1

Line 2

Line 3...

But, when I use @CR or Char(13), I just have 1 line with sentences separated with a kind of empty rectangle, like

Line 1[]Line2[]Line3...

I'm pretty sure it's a problem of character encoding.

Could someone help me ?

I've read the help file, but found nothing.

Thx in advance :)

Are you using FileWriteLine() or FileWrite() ?

You probably want to use @CRLF for newline.

:mellow:


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

#3 ·  Posted (edited)

@CRLF

Edit: JDeb beat me!! (Nyquil NightTime in the day... :) )

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Are you using FileWriteLine() or FileWrite() ?

You probably want to use @CRLF for newline.

:)

[EDIT]

You're too fast guys... :mellow:

Anyway, works well with @CRLF, thx a lot for such quick answers !

___________________________________

That was a fast answer, thanks!

I use that :

$output=$output&"Mytexte"&@CR

and at the end :

FileWrite(@SCRIPTDIR & "\Myfile.txt",$output)

Edited by nounourson

Share this post


Link to post
Share on other sites

Hello all,

With a loop, I write several lines in a txt file.

For each step of my loop, I'd like the lines to be one over the other, like :

Line 1

Line 2

Line 3...

But, when I use @CR or Char(13), I just have 1 line with sentences separated with a kind of empty rectangle, like

Line 1[]Line2[]Line3...

I'm pretty sure it's a problem of character encoding.

Could someone help me ?

I've read the help file, but found nothing.

Thx in advance :think:

I once used a manual typewriter (just for antiquity purposes). When I slammed the carriage return lever from left to right I noticed that it actually did two things.

1: It moved the carriage to the beginning on the same line.

2: Pressing the lever a little further actually moved the carriage up to the next line.

I wonder where @CRLF came from? :(

NB: I suspect the problem is not with your output, but what you are viewing it with. You are producing a delimiter that separates your lines and is quite valid and doubling the amount of space the delimiter uses could be somewhat wasteful on a large output file.

Share this post


Link to post
Share on other sites

NB: I suspect the problem is not with your output, but what you are viewing it with. You are producing a delimiter that separates your lines and is quite valid and doubling the amount of space the delimiter uses could be somewhat wasteful on a large output file.

Exactly. A text editor like Microsoft's infamous notepad expects @CRLF line endings.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

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