文件换格式我不会 但这有个字符串转成16进制的例子 你把文本里的东西读到Tstrings里转完再保存成文本吧
ss:='JHJKHH78798798jhjhjkhj**(*(*&';
sss:='';
if (length(ss) mod 4)<>0 then
begin
for i:=1 to (4-(length(ss) mod 4)) do
ss:='0'+ss;
end;
if ((length(ss) div 4) mod 2)<>0 then
ss:='0000'+ss;
for i:=0 to (length(ss) div 4) do
begin
IF copy(ss,i*4,4)='0000' then
sss:=sss+'0';
IF copy(ss,i*4,4)='0001' then
sss:=sss+'1';
IF copy(ss,i*4,4)='0010' then
sss:=sss+'2';
IF copy(ss,i*4,4)='0011' then
sss:=sss+'3';
IF copy(ss,i*4,4)='0100' then
sss:=sss+'4';
IF copy(ss,i*4,4)='0101' then
sss:=sss+'5';
IF copy(ss,i*4,4)='0110' then
sss:=sss+'6';
IF copy(ss,i*4,4)='0111' then
sss:=sss+'7';
IF copy(ss,i*4,4)='1000' then
sss:=sss+'8';
IF copy(ss,i*4,4)='1001' then
sss:=sss+'9';
IF copy(ss,i*4,4)='1010' then
sss:=sss+'A';
IF copy(ss,i*4,4)='1011' then
sss:=sss+'B';
IF copy(ss,i*4,4)='1100' then
sss:=sss+'C';
IF copy(ss,i*4,4)='1101' then
sss:=sss+'D';
IF copy(ss,i*4,4)='1110' then
sss:=sss+'E';
IF copy(ss,i*4,4)='1111' then
sss:=sss+'F';
end;