if OpenDialog1.Execute then begin i := 1; TmpStringList := TStringList.Create; AssignFile(fopen, OpenDialog1.FileName); Reset(fopen); try while not SeekEof(fopen) do begin ReadLn(fopen, s); TmpStringList.CommaText := s; if TmpStringList.Count > StringGrid1.ColCount then begin StringGrid1.ColCount := TmpStringList.Count; end; StringGrid1.RowCount := i + 1; StringGrid1.Rows[i].Assign(TmpStringList); Inc(i); end; finally TmpStringList.Free; CloseFile(fopen); end; end;