with Ada.Text_IO;
procedure FileExample is
-- Declaración de variables
File : Ada.Text_IO.File_Type;
Line : Ada.Text_IO.File_Type;
Text : String(1..100);
begin
-- Abrir el fichero en modo de lectura
Ada.Text_IO.Open(File, Ada.Text_IO.In_File, "ruta_del_fichero");
-- Leer y mostrar cada línea del fichero
while not Ada.Text_IO.End_Of_File(File) loop
Ada.Text_IO.Get_Line(File, Text);
Ada.Text_IO.Put_Line(Text);
end loop;
-- Cerrar el fichero
Ada.Text_IO.Close(File);
-- Puedes realizar otras operaciones con ficheros según tus necesidades
-- ...
exception
when Ada.Text_IO.Name_Error =>
Ada.Text_IO.Put_Line("Error: No se pudo abrir el fichero.");
end FileExample;