Código:
public
{ Public declarations }
strlist : TStringList;
procedure TForm1.FormCreate(Sender: TObject);
begin
Strlist:= TStringList.Create;
end;
procedure TForm1.Abrir1Click(Sender: TObject);
begin
if (opendialog1.Execute) then
begin
strlist.LoadFromFile(opendialog1.FileName);
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
strlist.Free;
end;
procedure TForm1.actualizarStringGrid;
var I:integer;
temp: string;
begin
for I:=1 to StringGrid1.RowCount do
StringGrid1.Rows[i].clear;
for I:= 0 to (strlist.count)-1 do
begin
temp:= strlist.Strings[i];// Aca serian los primero 160 caracteres
StringGrid1.Cells[0,I+1]:= copy(temp,1,8); // en cada una de estas filas copias la parte que quieras de los 160
StringGrid1.Cells[1,I+1]:= copy(temp,9,8);
StringGrid1.Cells[2,I+1]:= copy(temp,17,4);
StringGrid1.Cells[3,I+1]:= copy(temp,21,1);
StringGrid1.Cells[4,I+1]:= copy(temp,22,10);
......
StringGrid1.RowCount:=StringGrid1.RowCount+1;
end;
end;