LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I write from a text file into a 2D array?

I'm just starting out with labview. I need to take data from a text file/spreadsheet format write it into a 2D array.
0 Kudos
Message 1 of 5
(3,496 Views)
Enter the string "read spreadsheet into array" in the ask box on this discussion forum site and you'll see lots of related discussions on this topic. You can also look at some of the spreadsheet samples that ship with LabView.
0 Kudos
Message 2 of 5
(3,496 Views)
Hi,
use "Functions->File I/O->Read from spreadsheet file.vi"
Yuo can read 2D arrays from spreadsheet file with this vi.

Good luck.

Oleg Chutko.
0 Kudos
Message 3 of 5
(3,496 Views)
The read/write from spreadsheet file vi reads/writes single precision numbers only.
0 Kudos
Message 4 of 5
(3,496 Views)
fatmat13;

If I understand your question right, you want to read your data from a text file and view it as a 2D array. If your text file is made of numbers, you can use the VI Read from spreadsheet file.vi, located in the File I/O menu in the function palette.

If your file is made of letters, words, etc., then you need a modified version of that VI. I did the modification and I have that VI available from my website:

http://www.jyestudio.com/lview.shtml

The VI is Read Strings From Spreadsheet File.

I am attaching an example that use both the VI included with LabVIEW and the VI you can download from my website. I hope this is helpful. You need to put the files numbers file.txt and text file.txt in
the same directory.

Regards;
Enrique
www.vartortech.com
0 Kudos
Message 5 of 5
(3,496 Views)