Advanced Java question

<p>does anybody know how to use the BufferedReader class to read in data?</p>

<p>There is an input file that looks like this:</p>

<p>12388,2000
20039,2300
13900,3899
23900,3488</p>

<p>I needed to store these numbers into two parallel arrays. I don't understand how to read in one number at a time, disregarding the comma. the first column of numbers goes into one array. the second column of numbers goes in the second array.</p>

<p>you can read it from the text file one line at time. For every line, get 2 tokens with "'," as delimiter.</p>

<p>line = line.trim();
StringTokenizer tokens = new StringTokenizer(line, ",");
while(tokens.has....)
{</p>

<p>}</p>

<p>The other way:</p>

<p>int index = line.indexOf(",");
if(index > -1)
{
String num1 = line.substring(0, index);
String num2 = line.substring(index + 1);
}</p>

<p>hope it helps</p>