cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 2458|回复: 5

数据怎么保存为txt文件

[复制链接]
发表于 2008-12-5 15:17:09 | 显示全部楼层 |阅读模式
请问如何将4个通道采集的数据按行或者按列保存到文本文件中?请大家帮忙解答呀
发表于 2008-12-6 10:38:48 | 显示全部楼层
试试ArrayToFile函数,看行不
发表于 2009-7-21 11:21:57 | 显示全部楼层
发表于 2009-7-21 13:17:19 | 显示全部楼层
楼主是想将4个通道的数据保存在同一个文件中吗?如果是这样的话,那么你的数据是放在数组中的吗?如果是的话,那么可以直接用C的fprintf()函数,假如你将数据放在数组data[4]中,实现方法如下:
file_data=fopen(pfileName,"w+");
fprintf(file_data,"%4.3",data[0]);
fprintf(file_data,"%s","\t");
fprintf(file_data,"%4.3f",data[1]);
fprintf(file_data,"%s","\t");
fprintf(file_data,"%4.3",data[2]);
fprintf(file_data,"%s","\t");
fprintf(file_data,"%4.3f",data[3]);
fprintf(file_data,"%s","\n");
fclose(file_data);
这样就实现了按列存储(第一列为1通道的数据,第二列为2通道的数据,...),以上只是一个最简单的做法,楼主可以根据自己的需要进行扩充
发表于 2009-9-18 10:30:14 | 显示全部楼层
发表于 2009-10-6 15:08:39 | 显示全部楼层
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!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-4-20 17:44 , Processed in 1.558202 second(s), 9 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表