Load a .csv file into a string?

Get help using Construct 2

Post » Thu Dec 27, 2012 5:46 am

My goal is to upload a .csv file into the local file folder of my game. I want to then access the .csv file and store the values into strings which I will then manipulate with tokenat(ect).

I've tried searching the forums and came across this plugin
http://www.scirra.com/forum/plugin-csv-csv2array_topic46096_page1.html
and he says that I can use AJAX to get .csv string from external file.

So I've tried using the AJAX object but haven't had any luck. I was going to make a .capx but I have no idea how to use the AJAX properly to accomplish this, even after reviewing the AJAX object page in the manual.

https://www.scirra.com/manual/107/ajax

So if anyone can point me to a real basic example showing how to get from a locally stored .csv file to storing the values in a string, that would be great. Thanks!
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Thu Dec 27, 2012 6:12 am

B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Thu Dec 27, 2012 6:21 am

Thanks so much! I knew it was something real simple like that!
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Fri Mar 15, 2013 10:06 pm

i am also trying to utilize this plugin for my project.
Is there a way to save an excel file as csv, then import to project file, and then point to it from the event sheet? i have it imported, but not sure how i can point to it so that it can be loaded into my array object.
secondly, if a want to store a 'number' in my csv table, can i use it as a number and not just a string? for use with a variable?
B
1
Posts: 3
Reputation: 231

Post » Mon Jul 01, 2013 10:21 pm

I was hoping to get a copy of rexrainbow's capx file for this... the dropbox file appears to be gone...

It would probably answer a lot of questions I have with AJAX!

Thanks!
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Mon Jul 01, 2013 10:51 pm

You may find everything you need in the CSV plugin documentation rexrainbow put here :)
B
17
S
7
G
4
Posts: 461
Reputation: 5,907


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, emoticon, odiusfly and 19 guests