Board index » delphi » How to save Binary file to Text file

How to save Binary file to Text file

    Hi everybody, hope you all are fine.
    I have a question regarding the copying binary file to text file.
    Anybody have any idea ?
    I tried using TFileStream but i did not know how .

   Thanks a million.

 

Re:How to save Binary file to Text file


If you copy a binary file to a text file the contents will still be binary.
Can you explain in more detail what you are trying to accomplish?

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to questions received via email)

Re:How to save Binary file to Text file


On Tue, 28 Sep 1999 22:08:00 +0800, "StarWars"

Quote
<Yeobr...@singnet.com.sg> wrote:
>    I have a question regarding the copying binary file to text file.
>    Anybody have any idea ?
>    I tried using TFileStream but i did not know how .

If your question is "how can I convert binary information to text
format?", the easiest solution is to store it in hexadecimal format.
'AB'#10'C' would become '41420A43'.  You can use the IntToHex function
for this.

This method will double the space needed to store the information.  Of
course undoubtly there will be more efficient methods to do this...

Jan

Other Threads