        private Record convertLineToRecord(String line) {
            String tokens[] = splitFields(line);
            if (tokens.length != format.getFields().size() && !autoID) {
                throw new SessionInternalError("Mismatch of number of fields between " +
                        "the format and the file for line " + line + " Expected " + 
                        format.getFields().size() + " found " + tokens.length);
            }
            if (removeQuote) {
                for (int f = 0; f < tokens.length; f++) {
                    if (tokens[f].length() < 2) {
                        continue;
                    }
                    if ((tokens[f].charAt(0) == '\"' || tokens[f].charAt(0) == '\'') &&
                            (tokens[f].charAt(tokens[f].length() - 1) == '\"' || tokens[f].charAt(tokens[f].length() - 1) == '\'')) {
                        tokens[f] = tokens[f].substring(1, tokens[f].length() - 1);
                    }
                }
            }
            Record record = new Record();
            int tkIdx = 0;
            for (FormatField field:format.getFields()) {
                if (autoID && field.getIsKey()) {
                    record.addField(new PricingField(field.getName(),
                                files[fileIndex].getName() + "-" + counter ), field.getIsKey());
                    continue;
                }
                switch (PricingField.mapType(field.getType())) {
                    case STRING:
                        record.addField(new PricingField(field.getName(),
                                tokens[tkIdx++]), field.getIsKey());
                        break;
                    case INTEGER:
                        String intStr = tokens[tkIdx++].trim();
                        if (field.getDurationFormat() != null && field.getDurationFormat().length() > 0) {
                            record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                    convertDuration(intStr, field.getDurationFormat()) : null),
                                        field.getIsKey());
                        } else {
                            try {
                                record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                        Integer.valueOf(intStr.trim()) : null), field.getIsKey());
                            } catch (NumberFormatException e) {
                                throw new SessionInternalError("Converting to integer " + field + 
                                        " line " + line, AbstractFileReader.class, e);
                            }
                        }
                        break;
                    case DATE:
                        try {
                            String dateStr = tokens[tkIdx++];
                            record.addField(new PricingField(field.getName(), dateStr.length() > 0 ?
                                    dateFormat.parse(dateStr) : null), field.getIsKey());
                        } catch (ParseException e) {
                            throw new SessionInternalError("Using format: " + dateFormat + "[" +
                                    parameters.get("date_format") + "]", 
                                    AbstractFileReader.class,e);
                        }
                        break;
                    case DECIMAL:
                        String floatStr = tokens[tkIdx++].trim();
                        record.addField(new PricingField(field.getName(), floatStr.length() > 0 ?
                                new BigDecimal(floatStr) : null), field.getIsKey());
                        break;
                    case BOOLEAN:
                        boolean value = "true".equalsIgnoreCase(tokens[tkIdx++].trim());
                        record.addField(new PricingField(field.getName(), value), field.getIsKey());
                        break;
                }
            }
            record.setPosition(counter);
            return record;
        }

        private Record convertLineToRecord(String line) {
            String tokens[] = splitFields(line);
            if (tokens.length != format.getFields().size() && !autoID) {
                throw new SessionInternalError("Mismatch of number of fields between " +
                        "the format and the file for line " + line + " Expected " + 
                        format.getFields().size() + " found " + tokens.length);
            }
            if (removeQuote) {
                for (int f = 0; f < tokens.length; f++) {
                    if (tokens[f].length() < 2) {
                        continue;
                    }
                    if ((tokens[f].charAt(0) == '\"' || tokens[f].charAt(0) == '\'') &&
                            (tokens[f].charAt(tokens[f].length() - 1) == '\"' || tokens[f].charAt(tokens[f].length() - 1) == '\'')) {
                        tokens[f] = tokens[f].substring(1, tokens[f].length() - 1);
                    }
                }
            }
            Record record = new Record();
            int tkIdx = 0;
            for (FormatField field:format.getFields()) {
                if (autoID && field.getIsKey()) {
                    record.addField(new PricingField(field.getName(),
                                files[fileIndex].getName() + "-" + counter ), field.getIsKey());
                    tkIdx++;
                    continue;
                }
                switch (PricingField.mapType(field.getType())) {
                    case STRING:
                        record.addField(new PricingField(field.getName(),
                                tokens[tkIdx++]), field.getIsKey());
                        break;
                    case INTEGER:
                        String intStr = tokens[tkIdx++].trim();
                        if (field.getDurationFormat() != null && field.getDurationFormat().length() > 0) {
                            record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                    convertDuration(intStr, field.getDurationFormat()) : null),
                                        field.getIsKey());
                        } else {
                            try {
                                record.addField(new PricingField(field.getName(), intStr.length() > 0 ?
                                        Integer.valueOf(intStr.trim()) : null), field.getIsKey());
                            } catch (NumberFormatException e) {
                                throw new SessionInternalError("Converting to integer " + field + 
                                        " line " + line, AbstractFileReader.class, e);
                            }
                        }
                        break;
                    case DATE:
                        try {
                            String dateStr = tokens[tkIdx++];
                            record.addField(new PricingField(field.getName(), dateStr.length() > 0 ?
                                    dateFormat.parse(dateStr) : null), field.getIsKey());
                        } catch (ParseException e) {
                            throw new SessionInternalError("Using format: " + dateFormat + "[" +
                                    parameters.get("date_format") + "]", 
                                    AbstractFileReader.class,e);
                        }
                        break;
                    case DECIMAL:
                        String floatStr = tokens[tkIdx++].trim();
                        record.addField(new PricingField(field.getName(), floatStr.length() > 0 ?
                                new BigDecimal(floatStr) : null), field.getIsKey());
                        break;
                    case BOOLEAN:
                        boolean value = "true".equalsIgnoreCase(tokens[tkIdx++].trim());
                        record.addField(new PricingField(field.getName(), value), field.getIsKey());
                        break;
                }
            }
            record.setPosition(counter);
            return record;
        }
