Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static String[][] lerFicheiro(String nome) throws FileNotFoundException {
- int linhas = contarLinhas(nome);
- Scanner readF = new Scanner(new File(nome));
- String[][] mat = new String[linhas][COLUNAS];
- while (readF.hasNext()) {
- for (int l = 0; l < mat.length; l++) {
- String line = readF.next();
- if (line.length() > 0) {
- String[] lineS = line.trim().split(";");
- if(lineS.length==COLUNAS){
- for (int c = 0; c < mat[0].length; c++) {
- mat[l][c] = lineS[c];
- }
- }
- }
- }
- }
- readF.close();
- return mat;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement