The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

The Daily CLAD - Coding Challenge #1 - File Prefix Searcher

SercoSteveB
Active Participant

Task Overview

Consider the Front Panel shown below:

Coding Challenge 1.PNG


Construct a VI that performs a case insensitive search of a defined folder and lists all of the files within that folder whos filenames begin with a defined prefix.  The VI should by default only search within the folder specified but be capable of optionally including a recursive search of all subfolders within the defined start folder. 

The VI should output an array containing the pathnames of all files, within the search folder (or folders) whos filenames begin with the defined prefix.

The VI should detect any problems with data entered by the user, in particular into the Starting Folder and Filename Prefix controls, before any search operations are carried out and provide appropriate error codes and messages in Error Out.

Controls


NameTypeDescription
Starting Folder PathThe path from which to start the search
Serach SubfoldersEnumDefines if the VI should include a recursive search of subfolders within the 'Starting Folder'
Filename PrefixStringThe filename prefix to search for
Error InError ClusterDefault No Error In.

Indicators

NameTypeDescription
Files DetectedArray of PathsAn array containing the pathnames of files within the 'Starting Folder', and optionally its' subfolders, whos filenames begin with the string defined in 'Filename Prefix'.
Error OutError Cluster

Provides the user an indication of any errors encountered by the searcher.

NOTE:  A VI containing the Front Panel shown above is attached and could be used as a starting point for your VI.

Comments