我正在尋找一種方式來從4個字節的二進制文件,以數組或文本文件中把文本字符,如何將BINARY文件轉換/處理爲ASCII文件?
比方說我的輸入文件是:
00000000 2e 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 |................|
00000010 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 |................|
00000020 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000070 00 00 00 00 00 00 00 00 |........|
00000078
而我所需的輸出是:
46,1,2,3,4,5,6,7,8,9,0,0...
輸出可以是TEXT文件或數組。
我注意到包/解包功能可以幫助在這裏,但我想不出如何正確地使用它們,
一個例子是好的。
謝謝!我測試了它並完成了工作!如此優雅和簡單! – YoDar 2009-07-15 13:07:02