|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Ugurtan
The Dark Space Initiative Scary Wormhole People
8
|
Posted - 2014.11.11 12:13:06 -
[1] - Quote
What would I have to change in order to get a transposed output? Currently you write a new column for every rowset, but I would like to have a new row every rowset (if that makes any sense). The new googlespreadsheats seem todo this differently now (no more continue function it seems and I am getting errors that I have to manually add rows so your function can work. I have a feeling that will not happen if it expands "downwards" instead of "sideways".
edit: yeah as expected, if I wrap your function inside a transpose() the output gets done automatically and how i like it (rows, instead of columns), but I consider that ugly, so please get me a pointer how to change your function in the first place :-) |

Ugurtan
The Dark Space Initiative Scary Wormhole People
8
|
Posted - 2014.11.11 14:01:54 -
[2] - Quote
another questions (yeah before you get the chance to answer the first, nasty I know!):
how do I get one of the columns to be of type number instead of text? Currently everything you import is text and it would be nice if I could get the runs column from /char/blueprints as numbers.
|

Ugurtan
The Dark Space Initiative Scary Wormhole People
8
|
Posted - 2014.11.11 14:42:01 -
[3] - Quote
Steve Ronuken wrote:hrm. might be able to do something like value = children[i].getAttribute(attributes[subprefill.length]).getValue(); value = isNumeric(value)?parseFloat(value):value;
So just add the second line, after the first one. You'll also need to add the function below. It's not ideal, as it doesn't check to make sure that it's a float or an integer, but it should do the job. function IsNumeric(input) { return (input - 0) == input && input.length > 0; }
thanks Steve, but I already figured it out, using your blueprints.gs examples from github. I just added a before blueprints = I added
runs = +rows[i].getAttribute("runs").getValue();
and exchanged the last row[i] with runs
so the whole for block looks like this now:
for(var i = 0; i < rows.length; i++) { runs = +rows[i].getAttribute("runs").getValue(); blueprint=[rows[i].getAttribute("itemID").getValue(), rows[i].getAttribute("locationID").getValue(), rows[i].getAttribute("typeID").getValue(), rows[i].getAttribute("typeName").getValue(), rows[i].getAttribute("flagID").getValue(), rows[i].getAttribute("quantity").getValue(), rows[i].getAttribute("timeEfficiency").getValue(), rows[i].getAttribute("materialEfficiency").getValue(), runs] blueprints.push(blueprint); }
|

Ugurtan
The Dark Space Initiative Scary Wormhole People
8
|
Posted - 2014.11.11 14:44:34 -
[4] - Quote
thanks for the help in general guys! Now I only need to poke the API guy to "fix" /char/blueprints for me and I am set.
|

Ugurtan
The Dark Space Initiative Scary Wormhole People
8
|
Posted - 2014.11.11 15:58:43 -
[5] - Quote
speaking of being lazy (big fan here as well :-)), do you think it really necessary to test on the runs column? In that special case it should always return either -1 for a BPO or the actuall number of runs left for the BPC, so just hardconverting it to a number seems only fair. I surfed around and found that putting + infront of your expression does the trick. |
|
|
|