28 lines
933 B
Java
28 lines
933 B
Java
package org.palomafp.aadd.mag;
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.File;
|
|
import java.io.FileReader;
|
|
import java.io.IOException;
|
|
|
|
public class Fichero_01 {
|
|
public static void main(String[] args) {
|
|
File archivo = new File("C:\\Users\\alumnoT\\aadd\\fic01\\informacion_paises.txt");
|
|
|
|
try (BufferedReader br = new BufferedReader(new FileReader(archivo))) {
|
|
String linea;
|
|
System.out.println("Leyendo fichero de datos...");
|
|
|
|
while ((linea = br.readLine()) != null) {
|
|
if (linea.startsWith("#") || linea.trim().isEmpty()) {
|
|
continue;
|
|
}
|
|
|
|
System.out.println("Línea leída: " + linea);
|
|
}
|
|
|
|
} catch (IOException e) {
|
|
System.err.println("Error al leer el fichero: " + e.getMessage());
|
|
}
|
|
}
|
|
} |