Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 600 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Adding a new line to a txt file #353281
01/09/11 01:11
01/09/11 01:11
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Hey friends,

I am just playing around with some txt - ftp stuff and want to create a list of files hat need to be downloaded. I want the list to be like this

url to first thing
url to second thing
etc.

I know txt_load put every line in a seperate string, no problem. I just can't get it to work to enter a new line with \n. I enter two entrys, at the end of the string who is written stands a \n but If I open the txt file they aren't in two lines, it is just one long line.

Who can I do this? I don't want to open the notepad, press end and then enter as this isn't beautiful wink


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Adding a new line to a txt file [Re: Liamissimo] #353283
01/09/11 01:33
01/09/11 01:33
Joined: Jun 2008
Posts: 428
Rasch Offline
Senior Member
Rasch  Offline
Senior Member

Joined: Jun 2008
Posts: 428
Try to use .rtf instead of .txt

I also had problems with it. Otherwise this is some code i have used to write into .rtf files.

Code:
STRING* url_text = "";
str_cpy(url_text, "http://www.3dgamestudio.de/\n";

var filehandle = file_open_append ("url.txt"); // better use "url.rtf"
file_str_write(filehandle,url_text);
file_close (filehandle)



Re: Adding a new line to a txt file [Re: Rasch] #353285
01/09/11 01:44
01/09/11 01:44
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Good Idea, tried it but rtf is even stranger, the file gets bigger and bigger but shows nothing, just If i open it with Editor it shows my entrys, not useable like this =/


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Adding a new line to a txt file [Re: Liamissimo] #353286
01/09/11 01:47
01/09/11 01:47
Joined: Jun 2008
Posts: 428
Rasch Offline
Senior Member
Rasch  Offline
Senior Member

Joined: Jun 2008
Posts: 428
Do you want to write a list with gamestudio or to read a list?

Re: Adding a new line to a txt file [Re: Rasch] #353287
01/09/11 01:48
01/09/11 01:48
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
I want to write and read it and then upload it to the FTP. Everythings fine, except for the strange idea to enter a new line in a text file tongue

Just to see, this is what I am using
Code:
var filehandle = file_open_append("liam_new.txt"); ///LIAM VERSION!!! LIAM LÄDT AUF IMAD!!!
	str_cat(ftpurl,"\n");
	file_str_write(filehandle,ftpurl);
	file_close(filehandle);



Last edited by TheLiam; 01/09/11 01:52.

"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Adding a new line to a txt file [Re: Liamissimo] #353288
01/09/11 01:53
01/09/11 01:53
Joined: Jun 2008
Posts: 428
Rasch Offline
Senior Member
Rasch  Offline
Senior Member

Joined: Jun 2008
Posts: 428
maybe some code would give more ideas laugh

edit: alright. As i said i had these problems too with txt files. What exactly is not working with the .rtf files?

Last edited by Rasch; 01/09/11 01:54.
Re: Adding a new line to a txt file [Re: Rasch] #353289
01/09/11 01:53
01/09/11 01:53
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Imagine you the exmaple above two times, should enter a new line after each text, doesn't in fact.


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Adding a new line to a txt file [Re: Liamissimo] #353291
01/09/11 02:04
01/09/11 02:04
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline
User
the_mehmaster  Offline
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
What about a carriage return or line-feed? have you tried either or both?

EDIT: just found out windows notepad uses 'Carriage return,Line-feed' sequence for a new line grin, look 'em up in an ascii table somewhere.

That should be what your looking for.. Use all three characters(CR-LF-Newline), then it should work everywhere

Last edited by the_mehmaster; 01/09/11 02:11.
Re: Adding a new line to a txt file [Re: the_mehmaster] #353308
01/09/11 10:03
01/09/11 10:03
Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
GorNaKosh Offline
Junior Member
GorNaKosh  Offline
Junior Member

Joined: Feb 2009
Posts: 84
Deutschland/Niedersachsen
Yeah, had the same idea! Try '\r\n' instead of '\n' only. I remember some equal problems a long time ago...

Re: Adding a new line to a txt file [Re: GorNaKosh] #353311
01/09/11 10:46
01/09/11 10:46
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
I.am.happy.

Works fine, thank you! I would never have found a thing like this tongue


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1