LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read files in a given folder and give a list of files with their folder name

Dear all:
 
I need a help. I have hundreds of files in a certain folder, and need to read them one by one by a program. I use "List Folder" function to read the files, but the output has only the file name. The program requires each file with their folder name. Thank you very much for your help.
0 Kudos
Message 1 of 4
(3,163 Views)
Hi ccyang,

why don't you you use the 'build path' function?
The folder name is given as input to 'List folder', the filenames are the output from 'List folder'.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,157 Views)
Use 'Build Path' to create the full path to each file as I've shown in the picture. If these files are in subdirectories, you can use 'Recursive File List.vi' if you have LV 8.2 to get all the files in these directories including their paths. Come to think of it, you could just use the recursive VI to get all the paths even if there aren't any subdirectories.
 

Message Edited by Marc A on 05-14-2007 11:24 AM

Message 3 of 4
(3,157 Views)
Thank you very much for your replies! I got the correct information from both your post. Thanks again.
0 Kudos
Message 4 of 4
(3,132 Views)