How do I skip alternative rows in a CSV file?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Javier on 8th September 2016
Posted by Richard on 8th September 2016
Hi there,

I've updated the subject to what I think you're asking and if that's correct you can do it with a simple "for" loop adding 2 to the counter variable instead of the more usual 1:


var numrows = csv.numrows, rows = [];

for (var i=0; i<numrows; i+=2) {
     rows.push(csv.getRow(i));
}

// Show the variable
$p(rows);




Richard
Posted by Javier on 8th September 2016
row.push not saved as array, and I need to keep saving the values &#8203;&#8203;in an array.

Thankyou
Posted by Richard on 8th September 2016
Hi there,

I don't know what you're asking.



Richard
Posted by Javier on 8th September 2016
I mean the ROWS Variable (FOR) adds up the values &#8203;&#8203;that takes out the CSV and I want if I can keep saving in the array.

Thank you.
Posted by Richard on 8th September 2016
Hi there,

I still don't understand what it is that you're asking. You could try using gOOGLE Translate and see if that makes it any clearer:

translate.google.com/



Richard

Add a reply

 




« Back to message list
RGraph on social media