Jump to content

Character Encoding


Recommended Posts

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
Link to comment
Share on other sites

  • Developers

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:

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

Link to comment
Share on other sites

  • Moderators

@CRLF

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

Edited by SmOke_N

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.

Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
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!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...