I have a file with .dat extension which contains some binary data.i want to convert this to readable text format in c++.Read data line by line .
Asked
Active
Viewed 503 times
0
-
2You will need to know the details of the file format being used. Do you know this? If not this is a reverse engineering task. – Botje Mar 05 '20 at 10:42
-
@soniya jain - How do you define _line_ with _some binary data_? – Armali Mar 05 '20 at 10:50
-
What is your the line break character in `.data` ? do you know it ? – Landstalker Mar 05 '20 at 10:57
-
Hi all.. Thanks for your prompt response . @Landstalker line break character is \n – soniya jain Mar 05 '20 at 12:29
1 Answers
0
You have tried this way? Read / Write Binary Data.
You can now iterate the data in the buffer and cast them to a char.
Now you can write the chars.
Depending on your encoding the binary data will be "some char".
Linebreaks mostly are '10 or '13'.

ElHubert
- 21
- 7