You directly use text 1.txt:
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
000102030405060708090A0B0C0D0E0F
And
BAT:
@echo off
txt2bin 1.txt 1.bin
bin2txt 1.bin 2.txt
You'll know when you test it.
The correct 2.txt is:
000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F
Note:
For txt2bin, there's no need to consider converting 0D0A line breaks into the bin (after TXT is converted to BIN, there's no need to retain carriage returns and line feeds in the BIN; the last txt2bin program you made included 0D0A, which is not needed (the one at three o'clock in the afternoon is normal)), and 0D0A line breaks have no meaning in the BIN generated after txt2bin.
And for bin2txt, after BIN is converted to TXT, if there are 0D0A line breaks in the BIN data, they need to be converted to line breaks in the TXT (this BIN file was not generated by txt2bin, so it may contain 0D0A line breaks).
Actually, it's: txt2bin doesn't need to consider 0D0A line breaks, just write the characters into the BIN; bin2txt needs to consider 0D0A line breaks in the BIN to create line breaks in the TXT (a switch parameter can be considered to ignore 0D0A line breaks).
[
Last edited by zxcv on 2006-7-18 at 23:53 ]