Change high low status in a Java TXT

0
public void darDeBaja(Alumno obj) throws Exception
{
    archivo.seek(0);
    String linea;
    long lineaArchivo = 0;
    boolean encontro = false;
    while((linea = archivo.readLine()) != null && !encontro)
    {
        String[] campos = linea.split("\t");
        if(Integer.valueOf(linea.substring(0, 8)) == obj.getDni() && !"B".equals(campos[8]) )
        {
            archivo.seek(lineaArchivo);
            archivo.writeBytes(obj.toString() + "\tB" + System.lineSeparator());
            encontro = true;
        }
        else
        {
            lineaArchivo = archivo.getFilePointer();
        }
    }
}

I can not change the status field.

The structure of the record is:

DNI\tApellido y Nombre\tSexo\tFecha de nacimiento\tMaterias aprobadas\tPromedio\tFecha de ingreso\tCarrera\tEstado(este es el campo que tengo que modificar)

    
asked by Facundo Caseres 13.07.2018 в 23:58
source

0 answers