I'm doing a job where I need to save the information for a checking account, I need to read the information in a file (text) and split this information to divide it into account code , name and balance . Also, I need to save this information in an Array.
My problem is this: I can not splice this information to save in an Array. Could you help me?
I created a function reader ();
public void leitor() throws FileNotFoundException, IOException{
try (
BufferedReader reader = new BufferedReader (new FileReader ("arquivo.txt"));
) {
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
**String saida = line.split(";");**
System.out.println(saida);
}
}
}
It only reads the information from the file, however, I can not splice this information.