For a start, your data type does not match the problem.
The type Character
contains a single (ISO-8859-1) character. Your problem description sounds like you want to be able to store each block as an unspecified number of characters. The type Ada.Strings.Unbounded.Unbounded_String
is suited for that purpose.
with Ada.Strings.Unbounded;
...
type Block_Of_Characters is new Ada.Strings.Unbounded.Unbounded_String;
Your problem description is not explicit about the number of blocks of characters you expect, but for now I will assume that you always expect exactly three blocks (as your example data and source text both indicate).
type Block_Collection is array (Positive range <>) of Block_Of_Characters;
Blocks : Block_Collection (1 .. 3);
Opening the data file looks fine.
The read loop should be a bit different:
Buffer : Character;
begin
Open (File => Input_File,
Mode => In_File,
Name => "input.txt");
for Index in Blocks'Range loop
Read_A_Single_Block :
loop
exit when Index = Blocks'Last and End_Of_File (Input_File);
Get (File => Input_File,
Item => Buffer);
exit Read_A_Single_Block when Buffer = ' ';
Append (Source => Blocks (Index),
New_Item => Buffer);
end loop Read_A_Single_Block;
end loop;