How do I write data from an array to newline in text file

Get help using Construct 2

Post » Sat Aug 12, 2017 11:39 am

hi friends
i save my data from an array in game to a text file in desktop,but the data save in a line and i want save each of array's row in newline in text file.is there anybody know how can i do this in construct?
also i have another question is it possible to write and save data from array in construct to an excel file ?i need to save my data in to excel file but unfortunately i cant find a way to do this
B
3
Posts: 5
Reputation: 185

Post » Sat Aug 12, 2017 5:21 pm

aramesh wrote:hi friends
i save my data from an array in game to a text file in desktop,but the data save in a line and i want save each of array's row in newline in text file.is there anybody know how can i do this in construct?
also i have another question is it possible to write and save data from array in construct to an excel file ?i need to save my data in to excel file but unfortunately i cant find a way to do this


Use "\r\n" to insert a line break into a text file.

You can parse an array and save it out in csv format, which Excel can open. CSV is just the data of each table cell divided by a comma: https://en.wikipedia.org/wiki/Comma-separated_values
B
70
S
40
G
24
Posts: 518
Reputation: 20,070

Post » Sat Aug 12, 2017 9:38 pm

@digitalsoapbox thank you csv was perfect solution.however i did not understand your answer about line break.now my data is in array and i download its data as string (invoke download of string array.AsJSON ....) but unfortunately in excel all data shows in a line .do you have any suggestion about this?while i 'm using line break it shows as a string in excel file.
B
3
Posts: 5
Reputation: 185


Return to How do I....?

Who is online

Users browsing this forum: bluesun66, Kenthria, Malhog, plinkie, Yahoo [Bot] and 2 guests