Beginner CSV error



I am trying to read in CSV data. "test.scv"'s contents are:

1,2,3
4,5,6
7,8,9

My code is:

import java.io.*;
import com.Ostermiller.util.*;
class csvtest {
public static void main(String[] args) {
String[][] data = (new CSVParser(new
FileReader("test.csv"))).getAllValues();
System.out.println(data);
}}

The errors are:

unreported exception java.io.FileNotFoundException; must be caught or
declared to be thrown

String[][] data = (new CSVParser(new
FileReader("test.csv"))).getAllValues();
Note: .\com\Ostermiller\util\CSVParser.java uses unchecked or unsafe
operations.

Thank you for your help

Rob

.



Relevant Pages