LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting A Single Value From A .lvm File

Solved!
Go to solution

I have a large batch of spreadsheet files whose filename is a timestamp. I'm writing a program that will pull the value of a specific cell (the same cell in every file), pair it with the timestamp and then save each of these as a coordinate pair to a master spreadsheet. The goal is to extract one point from each of the 700 files I have and compile them in one file.

 

However, I've never used Labview to read files before. I've seen some stuff on how to read an entire spreadsheet into an array, but was wondering if there was a way to tell Labview to look into a file and pull out a single value. I open the .lvm files in Excel, so, in my mind, I'd be pulling out, for instance, Cell J2. Is this doable? Should I read the entire spreadsheet into an array, and use the index to pick it out of the array? If I do this, how would I specify cell J2 as an array index (I have no experience with arrays in Labview either). Also, if you have tips on how to easily save 700 coordinate pairs, gathered sequentially, to a single spreadsheet, that's my next task. 

 

Basically- I need to extract a single value from a spreadsheet in, ideally, the simplest way possible. Also, pointers on how to save numbers gathered in each iteration of a while loop to a single spreadsheet are welcome.

 

Thanks in advance for the help!

FYI- I have LabView v8.6

 

0 Kudos
Message 1 of 3
(2,395 Views)
Solution
Accepted by topic author okeeffe

You cannot tell LabVIEW to "pull out" a specific "cell" anymore than you can tell Notepad to do that. .lvm files are just text files. When you open them into Excel, the column delimiters (tabs by default) indicate to put the values into columns. In LabVIEW the Read Measurement File VI can be used to read .lvm files. It creates the evil dynamic data datatype which is next to useless. You'd need to convert that datatype to an array using the Convert From DDT function. Or, you can just use the Read Spreadsheet File VI. That will give you an array directly. You can just pull out the specific element using Index Array.

Message 2 of 3
(2,389 Views)

Thanks. I had seem someone talk about referencing cells and sheets in excel, and dealing with arrays seemed scary, so I thought I'd ask. I used the Read From Spreadsheet VI, pulled out the element I needed and built a new array with all of my data. Thanks for the help.

0 Kudos
Message 3 of 3
(2,373 Views)