public void File() throws IOException { BufferedReader in = new BufferedReader(new FileReader("d:\\uk0recaptrf.F2504300")); String str ; String tableau[]; tableau = new String[10]; int i=1; while ( (str = in.readLine()) != null) { str.split(";"); //System.out.println(str); tableau[i] = str ; System.out.println(tableau[i]); i= i+1; }
while ( (str = in.readLine()) != null) { String[] splits = str.split(";"); int taille = splits.length; for (int j = 0; i < taille; i++) { tableau[i + j] = splits[j]; } i += j; }
public void File() throws IOException { BufferedReader in = new BufferedReader(new FileReader("d:\\uk0recaptrf.F2504300")); String str ; String tableau[]; tableau = new String[15]; int i=0; while ( (str = in.readLine()) != null) { String[] splits = str.split(";"); int taille = splits.length; for (int j = 0; j < taille; j++) { tableau[i+j] = splits[j]; } } for( int k = 0 ; k<tableau.length; k++){ System.out.println(tableau[k]); } in.close();
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question