Caro muchas gracias me funcionó perfectamente, al final resultó más facil que de la forma en que lo estaba haciendo, ya que tomo los valores directamente del TStringList
Así quedó el código
Código Delphi
[-]
function CsvToStringGrid(AGrid: TStringGrid; ACSVFile: String): Boolean;
var
i,j,Columnas: integer;
aux: String;
p: TfrmProgress;
sl: TStringList;
begin
Result:= False;
sl:= TStringList.Create;
sl.LoadFromFile(ACSVFile);
aux:= sl[0];
Columnas:= ContarColumnas(aux);
AGrid.ColCount:= Columnas;
p:= TfrmProgress.Create(nil);
p.pbPrincipal.Min:= 0;
p.pbPrincipal.Max:= sl.Count;
for i := 1 to Columnas - 1 do
AGrid.Cells[i,0]:= GetColumna(i); j:= 0;
p.Show;
while (j < sl.Count ) and (p.Seguir = True) do begin
i:= 1;
AGrid.Cells[0,j]:= IntToStr(j+1);
aux:= sl[j];
while Pos(';',aux) > 0 do
begin
AGrid.Cells[i,j]:= Copy(aux,1,Pos(';',aux)-1);
Delete(aux,1,Pos(';',aux));
i:= i + 1;
end;
j:= j + 1;
AGrid.RowCount:= j + 1;
Result:= True;
p.pbPrincipal.Position:= j; p.Caption:= 'Completado: ' + IntToStr((j * 100) div sl.Count) + '%';
end;
p.Free;
end;
Saludos y muchas gracias