#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <fstream>
using namespace std;
int g_width = 2448;
int g_height = 2048;
#define NSIZE 8
void Bin2Text(const char* sIn,const char* sOut){
char buf[1024];
FILE* inFile = fopen(sIn, "rb");
FILE* outFile = fopen(sOut, "w");
int count = 0;
while(1)
{
int size = fread(buf, 8, 1, inFile);
if (size <= 0)
break;
count += size;
for(int i=0; i<size; i++)
{
unsigned char c = buf[i];
fprintf(outFile, "%d ", c);
}
if (count % g_width == 0)
fprintf(outFile, "\n");
}
}
int main()
{
char* raw0 = "E:/bcat/work/zhjpeg/src/zhjpeg/output.raw";
char* raw1 = "E:/bcat/work/zhjpeg/src/zhjpeg/output11.raw";
char* out0 = "./raw0.txt";
char* out1 = "./raw1.txt";
Bin2Text(raw0, out0);
Bin2Text(raw1, out1);
return 0;
}
RAW格式文件按转换为文本文件
最新推荐文章于 2025-04-21 20:19:19 发布
本文详细介绍了如何将RAW格式的数据文件转换成文本文件,包括转换方法、使用的工具和步骤,适合对数据处理和文件转换感兴趣的读者。

2622

被折叠的 条评论
为什么被折叠?



