LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I have a csv file read from excel to labview.

Hi,

I would like to read multiple csv files from excel to labview, creating a duplicate of the tables in excel, which would allow me to then draw some graphs for data analysis and comparison between the two.

Are there any examples that could be useful to what I am trying to do?

 

Thanks

0 Kudos
Message 1 of 14
(3,203 Views)

If the files are really csv format, simply read them using "read from spreadsheet file", and wire a comma as delimiter.

 

0 Kudos
Message 2 of 14
(3,195 Views)

That worked great, thanks.

From one of the csv files, I only require 3 of the columns. Is there a way to only read that part of the csv file?

0 Kudos
Message 3 of 14
(3,180 Views)

Patel33 wrote:

From one of the csv files, I only require 3 of the columns. Is there a way to only read that part of the csv file?


No. The characters in a file are just one long string and delimiters and linefeeds are special characters that defined where fields and lines start and end. As such, columns are interlaced into the file and consists of many small sections, where the position depends on the number of characters in each field, which is typically variable. You really need to read the entire file, then only look at the interesting columns later.

Message 4 of 14
(3,171 Views)

Ok. How do I add a graph, and only pull the three columns of data that is needed for it?

 

Thanks

0 Kudos
Message 5 of 14
(3,164 Views)

You can use "array subset" to get a subset of adjacent columns. If the desired columns are not adjacent, use e.g. undex array to get the desired columns.

0 Kudos
Message 6 of 14
(3,156 Views)

I have another question.

 

Iv'e decided to use tab control, I have the data in the first tab and would like to have the graph displayed in the second tab. Would the array subset and undex array still work for this? Or would I have to use a different function?

 

Thanks

0 Kudos
Message 7 of 14
(3,108 Views)

I have another question.

 

Iv'e decided to use tab control, I have the data in the first tab and would like to have the graph displayed in the second tab. Would the array subset and undex array still work for this? Or would I have to use a different function?

 

Thanks

0 Kudos
Message 8 of 14
(3,108 Views)

The Tab Control is just a front panel container.  It has no bearing on what functions you use in your block diagram.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 9 of 14
(3,102 Views)

Hi,

 

I have a read from spreadsheet for two different files each connected to an index array to grab a column from each table. These are wired to the xy inputs of the graph, but im not getting a plot on the graph. Any ideas on how to solve this?

 

Thanks

0 Kudos
Message 10 of 14
(3,076 Views)