procedure TForm1.N9Click(Sender: TObject); var f:textfile; r,i:integer; s:string; begin assignfile(f,'c:\qwerty\qwerty2.txt'); reset(f); readln(f,s); sg1.colCount:=strtoint(s); readln(f,s); sg1.rowcount:=strtoint(s); while not eof(f) do for r:=0 to sg1.ColCount-1 do for i:=0 to sg1.RowCount-1 do begin readln(f,s); sg1.Cells[r,i]:= s; end; end;