[PLUGIN] CSV, CSV2Array, CSV2Dictionary

Post your completed addons to share with the community

Post » Sat Sep 27, 2014 1:58 pm

@rexrainbow I did a couple days testing on this because when it wasn't working, I thought I had a flaw in my design. I wasn't able to see what the CSV had in memory in the debugger, so I wrote the contents to a Text object as I would use it. Everything seemed okay variable-wise.

The pick statement with the int(CSV.At("field",sprite.idnum) was NEVER true even though the data was there, so I thought I was doing something wrong. But when I replaced the CSV line with the constant value "3" it worked... which blew my mind! meaning that CSV statement was never giving the argument a "3" even though the data was there. I tried to preface the CSV line with int() or str() both in the Pick reference and in Set Entry to make sure it wasn't something funky like that, but it wasn't as far as I could tell.
B
51
S
13
G
7
Posts: 929
Reputation: 8,405

Post » Sat Sep 27, 2014 3:04 pm

@jobel

You could try dump csv value by action:log in browser plugin.
Or provide a simple test case to me.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sat Sep 27, 2014 3:07 pm

@jobel

BTW, why not use official save feature to save the game?
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sat Oct 18, 2014 12:28 am

First, thanks @rexrainbow for all of your amazing plugins. I'm using a couple of them and they are a lifesaver!
Now, I'm a total noob with this plugin and I'm trying to understand this very simple problem. Sorry if this is a very basic question.


I'm loading a csv file using AJAX and then trying to replicate whats in one of rexrainbow exemple capx files.
This is my code:

Image

Problem is that if I use AJAX.lastData instead of the line that is disabled, all I get to see in my game screen is 0 instead of the proper col, row answer.

What am I doing wrong? Thanks in advance!

Cheers


***I forgot to mention, previously I do a system on start of Layout ---- AJAX Request test.csv (tag "test")
B
35
S
8
G
11
Posts: 398
Reputation: 8,290

Post » Sat Oct 18, 2014 4:27 pm

@FraktalZero

Here is a sample capx about loading csv by AJAX.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sat Oct 18, 2014 4:35 pm

Ha! Although I had previously used your example, I didn't realize my mistake. I had ''AJAX.LastData'' instead of AJAX.LastData.
Thanks @rexrainbow :)
B
35
S
8
G
11
Posts: 398
Reputation: 8,290

Post » Tue Nov 25, 2014 7:00 am

@rexrainbow sorry I never replied.

using your plugin because it's just for loading data between layouts. It seemed easier than setting up a whole array.

also, I think my problem was some sort of picking issue. I've moved on since I now have it working, Thanks!
B
51
S
13
G
7
Posts: 929
Reputation: 8,405

Post » Sat Jan 24, 2015 9:28 pm

Hey I know this thread is a little old, but I'm trying to use this plugin and I can't get my excel spreadsheet to convert to CSV. It just makes an identical excel file with all my data in it, am I missing something?

EDIT: Nevermind, I realized what was up. My bad.
B
5
S
1
Posts: 59
Reputation: 497

Post » Wed Apr 08, 2015 10:27 am

Hi rex, could you make better example for ajax2cvs? current one shows me asian signs in open office and I have no clue what's going on?! THX!

Also, how exactly cvs2array works? Basically how my spreadsheet should be like in order to easily convert to array?
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Wed Apr 08, 2015 10:45 am

@megatronx

The content of ajax2cvs sample capx is
Code: Select all
,a,b
c,1,2
d,3,4

They are all ANSI imo, I am not sure why you got asian signs.

CSV2Array maps 2d data in to array.
Code: Select all
cell00,cell01
cell10,cell11

The X/Y mapping could be set in parameter of action.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests