LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get data from textfile

Solved!
Go to solution

Hello Forum,

 

Is it possible to get a 'specific' data that has been saved into a text file already, and put it into the front panel ?

 

Let's say, i want the maximum value of this part of the text file

 

23
21
94
56
78

 

Obviously, I want to get '94' out from the textfile, and into my VI's front panel.

 

Is LabVIEW able to do this ?

0 Kudos
Message 1 of 13
(3,183 Views)

Yes.

Read the file.

Use format spreadsheet string to array.

Then use min/max on the array and wire the max to an indicator.

 

Felix

0 Kudos
Message 2 of 13
(3,179 Views)

I'm sorry,

 

How do you 'Read the File' ?

0 Kudos
Message 3 of 13
(3,175 Views)

File I/O:

Read from Text File

even simpler

Read from Spreadsheet File

 

Felix

0 Kudos
Message 4 of 13
(3,170 Views)

Okay thanks!

 

Will try it when I'm on my main computer!

0 Kudos
Message 5 of 13
(3,168 Views)

When you get to that computer, you might also want to consider opening up the LabVIEW Help and doing some tutorials, as your question is extremely basic. To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.

0 Kudos
Message 6 of 13
(3,148 Views)

Hello, as you can see from the attachment,

 

I have 3 columns of numbers here.

 

First column, Angle of degree,

 

Second column, Average data,

 

Third column, statisical error

 

I would like to retrieve data from the MAXIMUM 'AVERAGE DATA' at which 'ANGLE OF DEGREE'

 

So, it would be best to retrieve the whole row, of the maximum average data.

 

How can I do so ?

 

I've tried the method you've suggested, but I can't seem to get it connected.

 

P.S: For this example(in attachment), the max degrees is at 20, and the average data at 4.16 ...

How do I get the whole row of data out and display it to the front panel ?

 

0 Kudos
Message 7 of 13
(3,120 Views)

hello PotatoMan,

use this vi and see if your function works.......................

 

0 Kudos
Message 8 of 13
(3,106 Views)
Solution
Accepted by ThePotatoMan

alok123, that VI simply will not work. The file contains a bunch of lines of headers, and your VI doesn't take this into account. The conversion will simply convert ALL lines, including the header. Thus, in this case it will pull out the line that says "Data per picture    800" because "Data per picture" will be converted to 0 and be in the first column, and 800 will appear in the second column. The third column will be zero. When you seach the second column for the largest value, you get 800. You need to chop off the header lines.

 

Besides, if you are going to read a file as a spreadsheet file, then simply use the Read From Spreadsheet File VI.

 


PotatoMan said:
I've tried the method you've suggested, but I can't seem to get it connected.

What do you mean you "can't seem to get it connected"? Show us what you did. A VERY simple solution is to use Read From Spreadsheet File, and chop off the lines which are the header. Then you can search the second column for the max value, and pick out the corresponding row. This is a corrected version of alok123's VI.

Message 9 of 13
(3,084 Views)

smercurio_fc,

 

Thanks for the correction.

I didn't seen the the whole file in hurry.

Hope you will continue with your suggestions in future.

0 Kudos
Message 10 of 13
(3,060 Views)