Leo el fichero uno de la siguiente manera:
Código PHP:
BufferedReader br1 = new BufferedReader(new FileReader (new File ("C:\\DB1.txt")));
String[] linea,urls;
String linea1,linea2;
while((linea1=br1.readLine())!=null){
if (linea1.trim().length()==0) continue;
linea=linea1.split(";");
Registro cadena= new Registro(linea);
//Guardamos todos los registros en un map
refs.put(cadena.ref, cadena);
}
br1.close();
Código PHP:
BufferedReader br2 = new BufferedReader(new FileReader (new File ("C:\\DB2.txt")));
while((linea2=br2.readLine())!=null){
if (linea2.trim().length()==0) continue;
urls = linea2.split(";");
for (Registro valor : refs.values()) {
if(valor.ref.equals(urls[0])){
valor.setUrl(urls[1]);
}
}
}
br2.close();
Gracias