I want to search "Move to: safe_right" in a text file which is log and updates very fast. I have having trouble using scan from a file function.
Please convey how can I use scan from file fuction to scan "Move to: safe_right"
The answer depends on many things. Who is modifying the file so fast?
One possibility would be to open the file read-only in parallel and keep reading from the last location, i.e. log entries since the last inspection. (There is no need to read the same thing from the beginning every time).
Is the code that writes the log to the file also LabVIEW code under your control? In that case it would be easier to trigger whatever needs to be done right there.
The log file is not under my control and I am reading the file from the current position as the file is changed. but the log file updates to fast and I am not able to scan the specified string. I also need to scan the file "Move to: safe_right" this particular but not able to do that. scan from file function throws an error- wrong format specifier.
scan from file function throws an error- wrong format specifier.
We can't help unless you actually show us some code, in particular the format specifier you are using. I am not even sure why you need a format specifier. You don't even tell us the error code!
You want to search but use "scan from file". "scan from file" does not search but scans according to the format you specify. If you want to search, you should use "match pattern" for example. Or do you have a very well formatted file, then scan from file could work, but please attach a sample of the file.