commit 640a7dce74650e82999fbf3c93b737ef494fe798 Author: marcos.alcalde1 Date: Wed Sep 23 20:53:15 2026 +0200 Subida de Actividad 1.1 Investigación sobre Ficheros y tratamiento I de Marcos Alcalde diff --git a/Actividad 1.1 Investigación sobre Ficheros y tratamiento I Marcos Alcalde.pdf b/Actividad 1.1 Investigación sobre Ficheros y tratamiento I Marcos Alcalde.pdf new file mode 100644 index 0000000..58de671 Binary files /dev/null and b/Actividad 1.1 Investigación sobre Ficheros y tratamiento I Marcos Alcalde.pdf differ diff --git a/Fichero_01.java b/Fichero_01.java new file mode 100644 index 0000000..7c9ffc9 --- /dev/null +++ b/Fichero_01.java @@ -0,0 +1,28 @@ +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()); + } + } +} \ No newline at end of file