LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Reading Files from Subfolders in Selected Folder PathList the elements

Solved!
Go to solution

Hello,

I'm encountering difficulties reading files located within subfolders of a folder I selected via a path in LabVIEW.

In my selected path, I chose the main folder I want to work with, and within this folder, I have three other subfolders. These three subfolders contain various files (.wav) that I need to display through an array indicator (string) on the front panel.

I tried using the "List Folder" function, but it only gives me the names of the subfolders. Upon further investigation, I learned that the filenames output of the "List Folder" function cannot provide me with the data within each folder ("This function does not return the names of files found in folders within the directory").

Is there a way for my program to return the names of those files within my three subfolders?

I also attempted to use the "Recursive File List" function, but it returns the directory of each file in the main folder. However, what I need is the name of the file, not its location.

I'm unsure of what else to try. Any help would be appreciated.

Thank you.

0 Kudos
Message 1 of 4
(464 Views)
Solution
Accepted by topic author asumm18

@asumm18 wrote:

 

Is there a way for my program to return the names of those files within my three subfolders?

I also attempted to use the "Recursive File List" function, but it returns the directory of each file in the main folder. However, what I need is the name of the file, not its location.

 


If I understood your needs correctly, then you might need something like that:

sp.png

Message 2 of 4
(449 Views)

That was it!!!!! Thank you so much

0 Kudos
Message 3 of 4
(411 Views)

There is another user on this Forum, @asumouq11, who posted "Music Player in LabVIEW" with a similar (identical?) problem, getting 18 Wave files, six in each of three sub-folders of a main "Music" folder, to play.

 

I wrote a very detailed "teaching" walkthrough of how to handle this using List Folder, which returns both an Array of Sub-folders (of the top-level folder) and an Array of Files (needed for each of the files).

 

If you are the same person, I'm disappointed that you resisted my efforts to show you how to "think about what you want to do, rather than how you should do it", and to actually learn some LabVIEW (which won't happen if we do your homework for you).  Otherwise, I recommend that you find this other Post (from two days ago) and see if the step-by-step written instructions I provided will teach you to solve the (almost identical) problem you are facing.  [Note that there are multiple ways to do this -- the method Andrey suggested can also be made to work.]

 

Bob Schor

0 Kudos
Message 4 of 4
(326 Views)