[PLUGIN] CSV, CSV2Array, CSV2Dictionary

Post your completed addons to share with the community

Post » Thu Jun 06, 2013 7:43 am

All right :) thanks. Will give it a try later today! :)
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 » Tue Jun 25, 2013 9:35 am

[QUOTE=JohnnySix] I read through all pages, and I couldn't find any reference, if I've repeated a previous question apologies!
I just have one question though, can you look up rows/columns without using strings as headers for row/columns?
I.E.

CSV.At(1,2)
rather than
CSV.At("THIEF", "ATK")

I did try, but I got an error saying it requires a string not an integer - so was wondering if there was a different action perhaps?
[/QUOTE]

I might be dumb but I have the same problem, how to get a specific cell without using headers, like in an array?
I did try CSV.At("1", "1") but of course I get:
[CSV] Expression:At - Can not find col index '1' in table.

Because after sorting rows by col, you don't know which row will be first, I'd like to get just the first cell of second row after a sort.
B
12
S
2
G
3
Posts: 16
Reputation: 2,813

Post » Tue Jun 25, 2013 10:05 am

If you need an index with this plugin you simply write it in. For instance, in my personal application of this I made my first column an index going from 1 to 30 starting at the second row. I could then pull data based off an integer requesting its index position followed by the 'type' of data, which is what my top row was filled with.

EX.
   Fish   Water   Temp
1 Bass   Fresh   76
2 Marlin Salt    65
3 Gar    Fresh   74

So if i wanted to scroll through this data I'd make a variable like:

Position = 1

And then call based on that:

On layout start
     Set text to Get CSV.At("Fish", position)
Next Button clicked add 1 to position
     Set Text to Get CSV.At("Fish", position)
Back Button clicked subtract 1 from position
     Set Text to Get CSV.At("Fish", position)

You would now be scrolling through the data by an index! Hope this helps!
B
8
S
1
Posts: 31
Reputation: 598

Post » Tue Jun 25, 2013 10:23 am

Thanks but what happens if you sort by temp first?
   Fish   Water   Temp
2 Marlin Salt    65
3 Gar    Fresh   74
1 Bass   Fresh   76

How do you get the Marlin line?j2l2013-06-25 10:24:08
B
12
S
2
G
3
Posts: 16
Reputation: 2,813

Post » Tue Jun 25, 2013 10:27 am

The only way I just found is:
For each row
i<=0

And action add +1 to i so basically the loop is for one line, the first one.j2l2013-06-25 10:27:52
B
12
S
2
G
3
Posts: 16
Reputation: 2,813

Post » Sat Jun 29, 2013 2:16 pm

Yeah, that's how i did it in one older prototype for showing items in inventory console style.
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 » Sat Jun 29, 2013 5:20 pm

Hey Rex, how can I check what entry is at particular position on table so I can have a conditional event? For example : if at col Gun and at row Bullet entry is even/uneven to 10 then do/not do something?

Also I can't remember what ENTRY IS VALID and KEY IN COL/ROW is for? ><''

Thanksmegatronx2013-06-29 17:26:21
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 » Sat Jun 29, 2013 11:39 pm

@megatronx

"condition: ENTRY IS VALID" could check if the target row,col is valid. For example , if the (col, row) = (Gun, Bullet) is not in the table, it will return false.

"condition:KEY IN COL/ condition:ROW" is similar with "condition: ENTRY IS VALID". For example , if "Gun" is in col , it will return true.
condition: ENTRY (Gun, Bullet) IS VALID = (condition:KEY "Gun" IN COL) and (condition:KEY "Bullet" IN ROW)

B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Sat Jun 29, 2013 11:43 pm

Ok thanks. But there is no way to check for value of entry is it?
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 » Sat Jun 29, 2013 11:58 pm

@megatronx

Do you mean that you want to get (col, row) key from entry value?
For example,
[code](Gun, Bullet) = 10[/code] Get key from value
[code]10 -> (Gun, Bullet)[/code]rexrainbow2013-06-29 23:59:00
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: DragoMej and 0 guests