I want to use a textfile and take each line and put it into an classobject array. This is my code
try {
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream("Patient.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
String strLine;
// Read file line by line
while ((strLine = br.readLine()) != null) {
// Print the content on the console
System.out.println (strLine);
}
// Close the input stream
in.close();
} catch (Exception e) { // Catch exception if any
System.err.println("Error: " + e.getMessage());
}
I need to transform this into an array object and this is how i want it to look like
Patient1 p[] = new Patient1[5];
p[0] = 001, "John", 17, 100, 65, 110, 110, 110, 109, 111, 114, 113, "Swaying, Nausea";
p[1] = 002, "Sun Min", 18, 101, 70, 113, 113, 110, 119, 111, 114, 113, "None";
and so on.