LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to scan for individual words from a text file?

Well, I have no idea where to start with this. Basically I want to write a program which scans for individual words from a text file. And then depending on what those words are it will execute further functions but for now I just want to figure out the first part: how to scan for individual words from a text file.

 

I believe I can accomplish this with the Scan From File function, but all the tutorials I find only talk about reading the file and outputting its contents. I want to do something with the contents instead of just outputting them.

0 Kudos
Message 1 of 7
(2,856 Views)
What's the format of the file? Reading and outputting the content to an array or string is where you would start.
0 Kudos
Message 2 of 7
(2,847 Views)

It is a '.txt' file. This file I have attached is what I have now. This seems to use a case structure and looks for the numeric value stated in the case within the file, then outputs whatever is after that value from the file. Problem is it only looks for numbers and not words. Plus I don't need the stuff after the number. I just need the one word if that makes sense. It's a start.

0 Kudos
Message 3 of 7
(2,836 Views)
Saying it is a '.txt' file is just meaningless. If you don't want to explain how the file is formatted or just post a small example, then you will have to work out the details yourself.
0 Kudos
Message 4 of 7
(2,831 Views)

It's a .txt, as is made with Windows Notepad. I've attached the actual file I'm using here. Not much, but this is it.

0 Kudos
Message 5 of 7
(2,825 Views)

If you are looking for specific words, then you might want to look at the Match Pattern function.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(2,819 Views)

Thanks crossrulz and Dennis. I figured out how to use it and Match Pattern is exactly what I needed.

0 Kudos
Message 7 of 7
(2,805 Views)