@Override
    public void run() {

        //logger.debug("proccessing file " + file.getName() + " numLines " + nLines);

        try {

            //validation of file
            if (!file.canWrite()) {
                return;
            }

            if (!validateName(file)) {
                return;
            }

            if (!validateNumLines(file)) {
                return;
            }

            scanner = new Scanner(file);
            scanner.useDelimiter(";\\s*");
            scanner.nextLine();
            scanner.nextLine();

            while (scanner.hasNext()) {

                //recordType                 
                record.setRecordType(scanner.next());
                if (!validateRecordType(record.getRecordType())) {
                    file.delete();
                    break;
                }

                record.setSourceIpAddress(scanner.next().trim());
                record.setDestinationIpAddress(scanner.next().trim());
                record.setConnectionId(scanner.next());
                record.setCalling(scanner.next());
                record.setSubAddress(scanner.next());

                //disconnect_text
                record.setDisconnectText(scanner.next());
                if (!validateDisconnectText(record.getDisconnectText())) {
                    scanner.nextLine();
                    continue;
                }
                record.setDisconnectText(cleanDisconnectText(record.getDisconnectText()));

                //dates
                record.setConnectTime(scanner.next());
                record.setConnectTime(formatDates(record.getConnectTime()));
                record.setDisconnectTime(scanner.next());
                record.setDisconnectTime(formatDates(record.getDisconnectTime()));

                record.setOrigin(scanner.next());
                record.setChargedUnits(scanner.next());
                record.setCallType(scanner.next());
                record.setTransmitPackets(scanner.next());
                record.setTransmitBytes(scanner.next());
                record.setReceivePackets(scanner.next());
                record.setReceiveBytes(scanner.next());

                if (record.getRecordType().equals("0")) {

                    //telephony
                    record.setTransmitDuration(scanner.next());
                    record.setSpeechDuration(scanner.next());
                    scanner.next();
                    record.setCoderRate(scanner.next());
                    record.setNoiseLevel(scanner.next());
                    record.setAcomLevel(scanner.next());
                    scanner.next();
                    scanner.next();
                    record.setPeerID(scanner.next());
                    scanner.next();
                    record.setLogicalIfIndex(scanner.next());

                } else {

                    //voIP
                    scanner.next();
                    record.setCoderRate(scanner.next());
                    scanner.next();
                    scanner.next();
                    record.setRemoteIpAddress(scanner.next());
                    scanner.next();
                    record.setRoundTripDelay(scanner.next());
                    record.setSelectedQos(scanner.next());
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    record.setLostPackets(scanner.next());
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    scanner.next();
                    record.setHiWaterDelay(scanner.next());
                    record.setLoWaterDelay(scanner.next());
                    record.setReceiveDelay(scanner.next());
                    record.setPeerID(scanner.next());
                    scanner.next();
                    record.setLogicalIfIndex(scanner.next());

                }

                //save record
                new DAO().create(record);

                //next line
                scanner.nextLine();

                // break because the file is rare
                if (count == nLines - 2) {
                    break;
                }

                count++;

            } // end while

        } catch (Exception e) {
            logger.error("run", e);
            e.printStackTrace();
        } finally {
            file = null;
            IOUtilities.closeScanner(scanner);
        }

    } // end run