A ver, yo usaría streams para leer de un archivo binario, ya que te hace transparente todo el jaleo de abrir y cerrar el archivo, así como un TStringList para guardar las líneas, ya que tb te permite llamar a SaveToFile ahorrándote tener que abrir y cerrar el archivo destino. Te quedaría más o menos así:
Código Delphi
[-]
procedure ConvertBinFileToTxtFile;
var
LStream: TMemoryStream;
miVar: longWord;
miStr: string;
todasMisStrings: TStringList;
I: integer;
begin
if not od.Execute then Exit;
LStream:=TMemoryStream.Create;
todasMisStrings:=TStringList.Create;
try
LStream.LoadFromFile(od.FileName);
LStream.Seek(0,soBeginning);
miStr:=''; I:=0;
while (I < LStream.Count - 1)
LStream.ReadBuffer(miVar, sizeOf(longWord));
miStr:=miStr+IntToHex(miVar,8); miStr:=miStr+' '; if (I mod 32)=0 then begin todasMisStrings.Add(miStr);
miStr:=''; end;
inc(I,4); end;
todasMisStrings.SaveToFile('C:\miArchivoDestino.txt');
finally
LStream.Free;
todasMisStrings.Free;
end;
end;
Acabo de escribirlo de cabeza, no sé si dará algún error más, pero vamos, creo que el concepto que quería transmitir queda bastante claro.
Espero haberte ayudado,
Un saludo,
LoPiTaL