I am trying to split a file I have read into an array. The file I am reading from is orderd like this.
- Lauri Maranto;manager
- Everett Flanders;manager
- Rachel Cornforth;designer
- Rocco Burks;designer
- Larue Maddox;designer
- Carmelo Grunden;tester
So here I put every line in an array, now im trying to put them in an arrayList and they have to be splitted.
try {
String bestand = "C:\\Users\\admin\\Documents\\java oo labo's\\ProjectBeheer\\data\\personeel.csv";
String[] lijnen = TextFile.readLines(bestand);
} catch (IOException io) {
System.out.println("error" + io.getMessage());
}
This is what I got but it only shows the latest value and then I get an error.
String[] items = null;
for (int i = 0; i < lines.length; i++) {
items = lines[i].split(";");
}
List<String> itemList = Arrays.asList(items);
System.out.println(itemList);
Someane knows what I can do? thanks.
The Problem now is that only the latest data is in itemList. This is the printout.
[Carmelo Grunden, tester]