How to open and read binary file?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello community,
How can I read a binary file? Example of this file is here: http://www.ex.ua/view_storage/614513727428. In *.pdf description about this file is written.
- 20 bytes - text
- 17 bytes - text
- 26 bytes - text and number
- 2 bytes - number
- 2 bytes - number
- 4 bytes - number
- ...
Maybe someone knows how to read binary file from fixed point, for example, from 74th byte?
Thanks in advance.
With best regards,
Andrew
댓글 수: 0
채택된 답변
Jan
2012년 12월 24일
FID = fopen(FileName, 'r');
if FID == -1, error('Cannot open file'); end
fread(FID, 73, 'int8'); % Skip 73 bytes
% Or: fseek(FID, 74, -1);
% Now the further FREAD commands come here...
fclose(FID);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!