Modififaciones
This commit is contained in:
Binary file not shown.
@@ -2,7 +2,6 @@ package org.palomafp.add.aez;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -23,15 +22,13 @@ public class Main {
|
||||
|
||||
try {
|
||||
reader = new BufferedReader(new FileReader(fichero));
|
||||
String linea;
|
||||
String linea = null;
|
||||
|
||||
while ((linea = reader.readLine()) != null) {
|
||||
linea = linea.trim();
|
||||
|
||||
if (linea.isEmpty() || linea.startsWith("#") || linea.startsWith("--")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Estructura según la nueva condición del profesor
|
||||
if (!linea.isEmpty() && !(linea.startsWith("#") || linea.startsWith("--"))) {
|
||||
String[] partes = linea.split(",");
|
||||
if (partes.length == 4) {
|
||||
String codContinente = partes[0].replace("\"", "").trim();
|
||||
@@ -50,9 +47,8 @@ public class Main {
|
||||
pais.getNombre());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
Reference in New Issue
Block a user