PDA

View Full Version : [JAVA] problema con findInLine


ilcavi87
14-02-2008, 18:09
String V[][] = new String [2000] [2000];
String D[] = {"nome=","cognome=", "tipologia=", "dip=", "AA="};

for (int t= 0; t <=4; t++){

for (int jj=0; Datix[jj]!=null ; jj++) {
Scanner sss= new Scanner(Datix[jj]).useDelimiter(";");
sss.findInLine(D[t]);
V[t][jj] = sss.next();
String datiok = V[t][jj];
if (!(sss.hasNext ())){
V[t][jj] = "xxx";
System.out.println (V[t][jj]);
}
else{

System.out.println (t + " " + jj + " " + " " + V[t][jj]);
}
}
(p.s. Datix [] prende in input un file .txt)

Il mio problema č questo: non trovando nome= oppure altri dati il programma inserisce i primi dati che trova invece che scrivere xxx come gli dico.

Altro problema: Stampa "nome=", ma se non c'č lui trova "cog nome=" e mi stampa quello....

HELP """

wingman87
14-02-2008, 18:46
Riscrivi (o meglio modifica) il post usando il tag CODE e spiegando meglio il problema, cosė non si capisce nulla.