public void readInPupils() throws InvalidDataException {
        ArrayList <String> ErrorPupil = new ArrayList();
        try {
            // TODO code application logic here
            Scanner scan = new Scanner(new File("D:/Pupils.csv"));
            
            
            while (scan.hasNextLine()) {
                String pup = scan.nextLine();

                String[] pupil = pup.split(",");

                try {
                    Pupil p = new Pupil();
                    p.setSurname(pupil[0]);
                    p.setForename(pupil[1]);
                    p.setGender(pupil[2]);
                    p.setDOB(pupil[3]);
                    p.setClassGroup(pupil[4]);
                    p.setForm(pupil[5]);
                    p.setUsername(pupil[6]);
                    p.setPassword(pupil[7]);

                    DBase.addPupil(p);
                    PrintToFile.printToLog("Added Pupil: " + p.getSurname() + " " + p.getForename());

                } catch (InvalidDataException e) {
                    PrintToFile.printToLog("Error: at Pupil " + pupil[0] + " " + pupil[1] + " " + e.toString());
                    String Error = pupil[0] + " " + pupil[1];
                    ErrorPupil.add(Error);
                }
            }
        } catch (IOException ex) {
            PrintToFile.printToLog("Error: " + ex.toString());
        } finally {
            PrintToFile.printToLog("Complete all valid Pupils added, students that need correcting are: ");
            for (String temp : ErrorPupil) {
            PrintToFile.printToLog("Pupil: " + temp); 
            }
        }
    }