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.
04-28-2016 02:14 PM
Is there a way to read all the subfolders inside a folder, all the files in those subfolders, and obtain the folder name of the last subfolder?
Any example will be greatly appreciated.
I tried something but it soesn't work.
Please help me.
Thanks in advance!
Solved! Go to Solution.
04-28-2016 02:22 PM
Recursive File List VI
Owning Palette: Advanced File VIs and Functions
Lists the contents of a folder or LLB. In order for this VI to work correctly, the LLB must have a .llb file extension.
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/recursive_file_list/
04-28-2016 02:24 PM - edited 04-28-2016 02:33 PM
never ming. I just figured out that I can truncate the path.
Thank you very much.
04-28-2016 03:08 PM
How would I get the last folder name?
04-28-2016 03:12 PM - edited 04-28-2016 03:13 PM
Hi Nando,
depending what you understand as "last folder" you can either use IndexArray to get the last element in the "All folders" array or you use StripPath to get the last part of a file path…
You know asking questions with some meaningful examples of "before" and "after" greatly helps to get better answers!?
04-29-2016 05:33 AM
Last could infer some form of sorting or priority to select only one folder from a group of folders in a folder that have no sub-folders (that even confuses me when I read it) , you really do need to be more specific in your requirements.
If you mean the names of all folders that have no sub-folders, then you can use the function you started with combined with the recurisive list function I pointed you to.
Specify a folder, use recursive list to get all sub-folder names, then iterate over the list and determine the number of sub-folders in that specific folder. If zero, use conditional terminal on auto-indexing tunnel to add to a list of folders with no sub-folders.