From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-27-2014 06:09 AM
I want to find a TXT in the current folder where the sequence is.Because the TXT name is not fixed,so every time I need to search and then get the path.
But FIndFile() cannot support a *.txt like below:
FindFile("*.txt", True, Locals.Path, 3)
Anyone has a solution?
Thanks!
08-27-2014 08:49 AM
How does the txt file get named? How do you know there will only be one txt file in that folder?
You could use a code module to parse through the files and return the path to the txt file. For example if you were using LabVIEW you could use the List Folders function and then parse for txt files.
If you want to keep it native to TestStand I think it would be tricky. You might be able to do something with the Call Executable step and some DOS commands.
If it were me I'd go with the code module option.
Ideally you'd know the name of the file and use the FindFile() like you are trying to. Is there any way to get the name of the txt file?
08-27-2014 07:23 PM
The txt file is provided by different users,so I don't know the file name.
I don't need to concern about the content of the txt,just read the txt file.
08-28-2014 01:21 PM
If you want to do a file system search you can use a .NET action step and set it to use mscorlib, and the System.IO.Directory class and then call the GetFiles method.
Hope this helps,
-Doug
09-03-2014 04:28 AM
Hi,
Maybe you could try to use the Engine.SearchFiles method (and then the Search Classes).
Or you can open the file "ForEach.seq" in <TestStand Path>\components\tools and take a look at the "FindFiles" sequence.
Regards
Bruno