LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scanning a text file to get a value

Solved!
Go to solution

Hello,

I want to scan a file to find a value for wCHI^2, which is given somewhere in the text file in the following way:

 

wCHI^2 = 739.59

 

 

The text file is an output file retrieved by some program. It is very long with many other informations and having alphabets and numerics both. I thought to scan for exact string 'wCHI' from the file but I do not know how it works.

 

Can somebody help me here please??

 

thanks a lot in advance

 

 

 

0 Kudos
Message 1 of 10
(3,680 Views)
Message Edited by Ravens Fan on 09-12-2009 09:46 PM
Message 2 of 10
(3,669 Views)

Hi Ravens

thanks for the reply. Still it is not clear to me how to scan the complete file for a particular string? I did not see any function for scanning the file.

 

to search for the following string+number from a particular file:

 

wCHI^2 = (some number to be read from the file)

 

Further, if there are more than one row with this string, is it possible to retrieve all the values from this file?  

 

thanks again

 

0 Kudos
Message 3 of 10
(3,657 Views)

maybe this will help:

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Download All
Message 4 of 10
(3,651 Views)

this may also help you:

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=418142&query.id=339123#M418142

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 5 of 10
(3,646 Views)

Thanks Harold,

I could not open the VI you posted as I ám using the older version 8.5.

The link was also helpful but partially, as the position of the string in the file is not fixed and I want to scan large number of files and the position of the string in the file varies from one to another.

 

 

It would be helpful if I can get the VI which I can open in LabVIEW 8.5

 

 

 

0 Kudos
Message 6 of 10
(3,626 Views)
What exactly are you having a problem with? You just have to use the Read From Text File function. Then it's just a matter of using the solution already given to you.
0 Kudos
Message 7 of 10
(3,620 Views)
here it is is 8.5
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 8 of 10
(3,615 Views)
Solution
Accepted by topic author arti.d

ravens fan is correct it is better to use the read from txt file function here that is:

 

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 9 of 10
(3,613 Views)

Finally my problme is solved.

Thanks a lot to Harold Timmis for explaining in detail and also to Raven Fan (though I could not use the example correctly, but thts my mistake).

 

 

 

 

0 Kudos
Message 10 of 10
(3,521 Views)