From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

folder list

Need a Labview program just to finish a small task.
got an array of string paths.

C:\MyPath\Folder_1
up to
C:\MyPath\Folder_255

The highest digits at the end of the folder name can be anything from 1 to 255.
Must do the following:
Need to make sure C:\MyPath exist.
Also,to go through each array element and get the Folder with the highest number at the end?.

0 Kudos
Message 1 of 3
(2,576 Views)

This is relatively simple to do with the "folder list" sub vi.

 

You will need to first check the list of folders from the parent folder (C: in this case). Search the returned list of folders for the target path that you want to check exists.

 

For the second part you need to extract the folder list from the child older (C:\MyPath). Then if the only things existing in that folder are the numbered folders, sort the list and take the last element. If you need the number it should be a simple matter to extract it from the string using "decimal string to number".

0 Kudos
Message 2 of 3
(2,566 Views)

No need to use List folder to list all availble folders and then verifying. Instead, use Check if File or Folder Exists VI to check the existence of folder, if exist then only use List folder.

-For second part, as suggested you can use extract the numeric portion and get the highest number string and use.

 

Thanks
uday
0 Kudos
Message 3 of 3
(2,555 Views)