We are about to switch to a new forum software. Until then we have removed the registration on this forum.
i had a csv file, this file stores thousands numbers in it . it looks like this when i use the println to print it out ! Screen Shot 2015-11-19 at 1.04.02 PM my question is how to convert this string to an int for every number in this file? example : - the 1st number will be x - the 2nd will be y - the 3rd will be color - the 4th will be another x - the 5th will be another y - the 6th will be another color the point(x,y) and color together will make an image but i need to convert them to int first before i can do other step
i had looked at the way to do it, but i did not get any result Thanks so much if you can have look and help me oh i cannot use array for this question
Answers
i did read all of this, but they did not work, since the string is not there like String s = " 12,14,15,13,13 " Do you get what i meant ?
Indeed Processing's reference is too incompetent to even have some CSV example in loadString() reference!
Go to "Reading and Writing Text Files" section @ https://Processing.org/tutorials/data/
In the original csv file the 3 values are just separated by comma and eaxh 3 values by line break?
the file contains thousands of values and each of them separate by the comma
like this
?
is it so?
that would apply when you have lines with 3 values on each line (like shown above)
does only work with lines of this format
i am so sorry when this has to work with only string, without array
You convert the string to array
You can also read the string char by char with charAt and on the way add the values until you reach a comma,
again wait till you have 3 values and then produce the point/ rect
Very inconvenient
yeb , it is true, it is not convinience
Show your attempt