here i have code it work well here i have assigned size of the row and column. how can i get the row and column value from text file.
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class csvimport5 {
public static void main(String[] args) throws IOException {
File file = new File("D:\\PROJECT_JAVA\\buydata.txt");
int row = 0;
int col = 0;
//Scanner in = new Scanner(System.in);
double [][] data = new double [87][2];
BufferedReader bufRdr = new BufferedReader(new FileReader(file));
String line = null;
while((line = bufRdr.readLine()) != null && row < data.length)
{
StringTokenizer st = new StringTokenizer(line,",");
while (st.hasMoreTokens())
{
try {
data[row][col] = Double.parseDouble(st.nextToken());
} catch (NumberFormatException e) {
}
col++;
}
col = 0;
row++;
}
System.out.println(" "+data[86][1]);
}
}