Así que esto es lo que tengo hasta ahora:Método para buscar cadena dentro del archivo de texto. A continuación, obtener las siguientes líneas hasta un cierto límite
public String[] findStudentInfo(String studentNumber) {
Student student = new Student();
Scanner scanner = new Scanner("Student.txt");
// Find the line that contains student Id
// If not found keep on going through the file
// If it finds it stop
// Call parseStudentInfoFromLine get the number of courses
// Create an array (lines) of size of the number of courses plus one
// assign the line that the student Id was found to the first index value of the array
//assign each next line to the following index of the array up to the amount of classes - 1
// return string array
}
sé cómo encontrar si un archivo contiene la cadena que estoy tratando de encontrar, pero no sé cómo recuperar toda la línea que está en.
Esta es la primera vez que publico, así que si he hecho algo mal por favor avíseme.
Si esta es la tarea, debe ser etiquetado como tal. –
¿Se puede agregar una muestra del archivo de entrada? – RonK