Ver Mensaje Individual
  #6  
Antiguo 24-02-2015
engranaje engranaje is offline
Miembro
 
Registrado: may 2011
Posts: 163
Reputación: 14
engranaje Va por buen camino
Habría que comprobar con los mismos ficheros que tú para estar seguro pero por probar he preparado algo asi en una unit y da la sensación de funcionar como se espera.

Código Delphi [-]
function LeeFichero(const fichero: String): AnsiString;
var
  F: file;
  cuantos: Integer;
  Buf: array[1..1024] of Char;
begin
  result := '';
  AssignFile(F, fichero);
  Reset(F, 1);

  repeat
    BlockRead(F, Buf, SizeOf(Buf), cuantos);
      result := result + Buf;
  until (cuantos = 0);

  CloseFile(F);
end;

function cortar(ruta, delimitador1, delimitador2: string): Ansistring;
begin
  result := LeeFichero(ruta);
  Delete(result, 1, AnsiPos(delimitador1, result) + Length(delimitador1) - 1);
  SetLength(result, AnsiPos(delimitador2, result) - 1);

  if result = '' then
    Result := 'Error';
end;
Responder Con Cita