Completed importCSV method
Added BufferedReader with FileReader surrounded by a try/catch
This commit is contained in:
parent
5a678633b7
commit
f29925a78e
@ -1,4 +1,7 @@
|
|||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Matrix {
|
public class Matrix {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@ -7,7 +10,22 @@ public class Matrix {
|
|||||||
|
|
||||||
public String[] importCSV() {
|
public String[] importCSV() {
|
||||||
String[] result = null;
|
String[] result = null;
|
||||||
|
String line;
|
||||||
|
try {
|
||||||
|
BufferedReader br = new BufferedReader(new FileReader(""));
|
||||||
|
|
||||||
|
line = br.readLine();
|
||||||
|
|
||||||
|
while (line != null) {
|
||||||
|
result = line.trim().split(";");
|
||||||
|
}
|
||||||
|
|
||||||
|
br.close();
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.getStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.getStackTrace();
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user