数据怎么保存为txt文件
请问如何将4个通道采集的数据按行或者按列保存到文本文件中?请大家帮忙解答呀 试试ArrayToFile函数,看行不 用文件 楼主是想将4个通道的数据保存在同一个文件中吗?如果是这样的话,那么你的数据是放在数组中的吗?如果是的话,那么可以直接用C的fprintf()函数,假如你将数据放在数组data中,实现方法如下:file_data=fopen(pfileName,"w+");
fprintf(file_data,"%4.3",data);
fprintf(file_data,"%s","\t");
fprintf(file_data,"%4.3f",data);
fprintf(file_data,"%s","\t");
fprintf(file_data,"%4.3",data);
fprintf(file_data,"%s","\t");
fprintf(file_data,"%4.3f",data);
fprintf(file_data,"%s","\n");
fclose(file_data);
这样就实现了按列存储(第一列为1通道的数据,第二列为2通道的数据,...),以上只是一个最简单的做法,楼主可以根据自己的需要进行扩充 学习一下。 A friend of mine purchased Replica Rolex.The appearance of the watch is so nice that i also want to own it! We together lodged in the web Replica Rolex and chose an attractive Replica Watches.It feels so good that i always wear it on my hand.By now i have worn it for three months and have not found any problem.No wonder the quality is favorable. I believe it and will introduce it to more people!
页:
[1]