Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/12/2012, 12:10
jorcox
 
Fecha de Ingreso: diciembre-2012
Mensajes: 2
Antigüedad: 12 años, 1 mes
Puntos: 0
Duda con el useDelimiter

Yo tengo en un fichero de texto, lo siguiente:

Código:
ELENA, CARPINTERO GUTIERREZ, 48898213, false
JOSE LUIS, MERINO ARAGON, 48960524, false
ALONSO, BIEL OTAL, 48999262, true
JARA, SORIANO ZALDUA, 49022677, false
PEDRO MIGUEL, JOSA ZAMORA, 49047932, false
FRANCISCO, BERGUA CASAS, 49141190, false
MARIA LUISA, SARASA SILVA, 49180919, false
LUIS ALBERTO, FELIU CARDONA, 49224620, false
LIDIA, BALMES RAMIREZ, 49268257, true

Mi problema es que al querer leer el booleano coge el false y el nombre de la linea de abajo. Es decir coge por ejemplo "false JOSE LUIS"

Código:
f.useDelimiter(",\\s*");
String nombre=f.next(); String apellidos=f.next(); 
int dni=f.nextInt(); boolean casado=f.nextBoolean();
¿Como lo soluciono?

Última edición por jorcox; 29/12/2012 a las 14:58