NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

求助:怎样用Labview自动读取多个TXT文件数据放到一个EXCEL文件内?

谢谢大家。

我现在通过数据采集卡采集到了500组数据,放到了500个TXT文件内。现在想把这500组数据依次放到一个EXcel文件内。怎么才能自动读取这500个TXT文件呢?

谢谢大家了!

0 项奖励
1 条消息(共 3 条)
6,945 次查看

Assuming that you have all TXT files stored under a known folder/ directory...

 

Use List Folder/Directory to obtain the filenames found/ stored under that folder/ directory. Passing the filenames (array) through a for-loop and Build (Path) corresponding file path(s) and Read that (Text) File. The (auto) indexed string output from the Read from Text File can then be processed i.e. Concatenate, Array To Spreadsheet String etc. and transform into the desire output/ format for saving.

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
2 条消息(共 3 条)
6,932 次查看

如果文件名有规律,可以用for循环,每个循环里自动修改到相应的路径然后打开txt,循环终止时再写入电子表格就可以了。

计术卡读取数据存储的时候可以尝试用“保存到电子表格中“的”追加到电子表格”,这样就可以存到一个文件中了。或者在读取的程序里用生产者消费者结构,在消费者结构中用移位寄存器,自动处理所得数据,然后将最终数据保存到电子表格(譬如txt文件)。

0 项奖励
3 条消息(共 3 条)
5,984 次查看