У вас ведь текстовый файл, с ним нужно так
Код:
procedure TForm1.FormCreate(Sender: TObject);
var
f: textFile;
th: string;
begin
AssignFile(f, 'E:\Delphi\Lab2\TExt1.txt');
Reset(f);
while not eof(f) do
begin
ReadLn(f, th);
Label2.Caption:= Label2.Caption + th + ' ';
if (Pos(',', th) + 2 = Length(th)) and
(StrToInt(th[Length(th) - 1]) + StrToInt(th[Length(th)]) = 7) then
label4.Caption:= Label4.Caption + th + ' ';
end;
CloseFile(f);
end;
без матраскладок