if(!br.readLine().equals(EXPORT_CSV_FORMAT)){ Debug.err("Wrong file type or corrupted file");
line = br.readLine(); if(line.equals(EXPORT_CSV_FORMAT_JFRITZ) || line.equals(EXPORT_CSV_FORMAT_FRITZBOX)){  if(line.equals(EXPORT_CSV_FORMAT_JFRITZ)) isJFritzExport = true;  int linesRead = 0; int newEntries = 0; Call c; while(null != (line = br.readLine())){ linesRead++; if(isJFritzExport) c = parseCallJFritzCSV(line); else c = parseCallFritzboxCSV(line);  if(c == null) Debug.msg("Error encountered processing the csv file, continuing"); else if(addEntry(c)){ newEntries++;  } }  Debug.msg(linesRead+" Lines read from csv file "+filename); Debug.msg(newEntries+" New entries processed");  if (newEntries > 0) { sortAllUnfilteredRows(); saveToXMLFile(JFritz.CALLS_FILE, true); String msg;  if (newEntries == 1) { msg = JFritz.getMessage("imported_call"); } else { msg = newEntries + " "+JFritz.getMessage("imported_calls"); }  JFritz.infoMsg(msg);  }else{ JFritz.infoMsg(JFritz.getMessage("no_imported_calls")); }
	  public void importFromCSVFile(String filename){	    //Is the performace gain from this really worth it?	    //And if there are duplicate calls, only the first one gets filtered out	    alreadyKnownCalls = (Vector) unfilteredCallerData.clone();	    Debug.msg("Importing from csv file " + filename);	    String line = "";	    try {	      FileReader fr = new FileReader(filename);	          BufferedReader br = new BufferedReader(fr);	             	          if(!br.readLine().equals(EXPORT_CSV_FORMAT)){	              Debug.err("Wrong file type or corrupted file");	          }else{	            int linesRead = 0;	            int newEntries = 0;	            while(null != (line = br.readLine())){	              linesRead++;	              Call c = parseCall(line);	              if(c == null)	                Debug.msg("Error encountered processing the csv file, continuing");	              else if(addEntry(c)){	                newEntries++;	                	              }	            }	            Debug.msg(linesRead+" Lines read from csv file "+filename);	            Debug.msg(newEntries+" New entries processed");	                                 	            if (newEntries > 0) {	              sortAllUnfilteredRows();	              saveToXMLFile(JFritz.CALLS_FILE, true);	              String msg;	              	              if (newEntries == 1) {	                msg = JFritz.getMessage("imported_call");	              } else {	                msg = newEntries + " "+JFritz.getMessage("imported_calls");	              }	              JFritz.infoMsg(msg);	          	            }else{	              JFritz.infoMsg(JFritz.getMessage("no_imported_calls"));	            }	                	                	          }             	          	          br.close();	          } catch (FileNotFoundException e) {	              Debug.err("Could not read from " + filename + "!");	          } catch(IOException e){	            Debug.err("IO Exception reading csv file");	          }	          	  }