使用 LabVIEW 将行插入 Excel 电子表格

发布于 2024-10-10 05:36:53 字数 318 浏览 0 评论 0原文

我有一个 Excel 电子表格,其中仅包含 rng A1:A24 中的数据。

aaa

aaa

aaa

aaa

aaa

..

..

..

我想在此列之前添加一列数据。这样就会有2列:

bbb aaa

bbb aaa

bbb aaa

... ...

... ...

... ...

... ...

在LabView中怎么做?

I have a excel spreadsheet which just contains data in the rng A1:A24.

aaa

aaa

aaa

aaa

aaa

..

..

..

I want to add one col of data before this col. So it will have 2 col:

bbb aaa

bbb aaa

bbb aaa

... ...

... ...

... ...

... ...

How to do it in LabView?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挽清梦 2024-10-17 05:36:53

读/写电子表格文件VI不读取.xls文件。不过,这对于 .csv 来说效果很好。 NI 论坛上的此帖子包含大量相关内容在 LabVIEW 中操作 Excel 文件。

Read/Write spreadsheet file VIs don't read .xls files. This will work fine for .csv, though. This thread on the NI forum that contains a ton of stuff related to manipulating Excel files in LabVIEW.

梦年海沫深 2024-10-17 05:36:53

请按照 NI 的以下步骤操作:将 Microsoft Excel 数值数据读入 LabVIEW
引用链接:

使用读取测量文件
表达VI:

您可以读取数字数据
将 Excel 电子表格导入 LabVIEW
使用读取测量文件
通过两步过程表达 VI。
首先,将 Excel 电子表格另存为
制表符分隔的文本文件。然后,
将 *.txt 文件重命名为 *.lvm 文件。
读取测量文件 Express
VI现在可以将数值数据读入
LabVIEW。以下步骤将
引导您完成整个过程。

  1. 打开包含简单数字信息的 Excel 电子表格。
  2. 将 Excel 电子表格另存为制表符分隔的文本文件。
  3. 单击“确定”。请注意,您仅保存来自
    活动工作表。
  4. 点击“是”。
  5. 关闭您的 Microsoft Excel 文档。
  6. 导航至将 Excel 文档保存为选项卡的位置
    分隔文本文件,右键单击
    您的 filename.txt 文档,选择
    重命名,并将文件重命名为
    .lvm 扩展名,以便您的文件现在
    显示为文件名.lvm。
  7. 通过指定将数字电子表格数据读入 LabVIEW
    filename.lvm 作为文件名
    读取测量文件 Express VI
    配置窗口。

导航到您所在的位置
将 Excel 文档另存为选项卡
分隔文本文件,右键单击
您的 filename.txt 文档,选择
重命名,并将文件重命名为
.lvm 扩展名,以便您的文件现在
显示为文件名.lvm。

使用读取电子表格文件VI:

LabVIEW VI“从电子表格读取”
File.VI'不直接读取.xls
文件,而是分隔文本
文件。

如果您创建了 Excel 电子表格
通过手动输入数据(不是
使用 LabVIEW 和写入
电子表格文件 VI) 读取
电子表格文件 VI 将无法正常
解释您的 .xls 文件并将
将零返回到数组中。在
为了将此数据放入数组中
在LabVIEW中你必须保存
Excel 文件为制表符分隔文本
文件。其过程可以是
如上例所示。现在
将这个新的 .txt 文件输入到
读取的文件路径节点
电子表格文件 VI 将填充您的
具有正确数据的数组。如果你
只需要第一列数据,
您可以将 True 常量连接到
转置?节点和第一行
输出会给你一个数组
第一列数据的值。

Follow these steps from NI: Reading Microsoft Excel Numeric Data Into LabVIEW.
Quoting the link:

Use the Read From Measurement File
Express VI:

You may read numeric data
in an Excel spreadsheet into LabVIEW
using the Read From Measurement File
Express VI through a two step process.
First, save your Excel spreadsheet as
a tab delimited text file. Then,
rename the *.txt file as a *.lvm file.
The Read From Measurement File Express
VI can now read the numeric data into
LabVIEW. The following steps will
walk you through the procedure.

  1. Open your Excel spreadsheet containing simple numeric information.
  2. Save your Excel spreadsheet as a tab delimited text file.
  3. Click OK. Note that you are only saving numeric data from the
    active worksheet.
  4. Click Yes.
  5. Close your Microsoft Excel document.
  6. Navigate to the location where you saved your Excel document as a tab
    delimited text file, right-click on
    your filename.txt document, select
    Rename, and rename you file with a
    .lvm extension so that your file now
    appears as filename.lvm.
  7. Read your numeric spreadsheet data into LabVIEW by specifying
    filename.lvm as the File Name in the
    Read From Measurement File Express VI
    configuration window.

Navigate to the location where you
saved your Excel document as a tab
delimited text file, right-click on
your filename.txt document, select
Rename, and rename you file with a
.lvm extension so that your file now
appears as filename.lvm.

Use the Read From Spreadsheet File VI:

The LabVIEW VI 'Read From Spreadsheet
File.VI' does not directly read .xls
files, but rather delimited text
files.

If you created your Excel spreadsheet
by manually entering the data in (not
using LabVIEW and the Write to
Spreadsheet File VI) the Read From
Spreadsheet File VI will not properly
interpret your .xls file and will
return zeros into your array. In
order to get this data into an array
in LabVIEW you will have to save the
Excel file as a tab delimited text
file. The procedure for this can be
seen in the example above. Now
inputting this new .txt file into the
file path node of the Read From
Spreadsheet File VI will populate your
array with the proper data. If you
just need the first column of data,
you can wire a True constant to the
Transpose? node, and the First Row
output will give you an array with the
values of your first column of data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文