10-14-2021 10:30 AM
Hey NI Crew,
Here's a simple one for ya. I'm trying to use the Scan From String to dig through a bunch of data files to find the appropriate files. I can do it to a certain point. I'm looking for files that are identified as Passed but also have the .txt extension. The .txt extension is causing this to not work. I remove it, and I get all the passed files, but every different type of extension. What's the magic trick here? Using LabVIEW 2009, fyi. So don't send me any VIs beyond that please.
10-14-2021 10:35 AM - edited 10-14-2021 10:38 AM
Apply the file extension to the "pattern" input on the "recursive file list" block.
Have fun.
0xDEAD
edited to add: In your case "pattern" would be *.txt
10-14-2021 10:45 AM - edited 10-14-2021 10:47 AM
@deceased wrote:
Apply the file extension to the "pattern" input on the "recursive file list" block.
Have fun.
0xDEAD
edited to add: In your case "pattern" would be *.txt
If the standard wildcards work then a pattern like ?Passed.txt might work better
10-14-2021 10:47 AM
Hmmm... I mean sure if you wanted to do it the easy way. LOL
Thank you.
10-14-2021 11:10 AM - edited 10-14-2021 11:12 AM
If you wanted to keep with the Scan From String, you need to use "%[^.]" instead of "%s". The bracket notation looks for specific characters and the ^ states not the next character. To this will take all characters up to the period. The normal %s looks for a white space to stop the scan.
But the super easy method is to use the Recursive File List.vi and use "Passed_Report_*.txt" as your pattern.