Showing results for 
Search instead for 
Did you mean: 

How to open all the text files within a folder at once so that they run through my VI in the correct order and the VI only needs to be ran once per folder?

Go to solution

Uh oh, that's not good


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'

0 Kudos
Message 11 of 18

hi caro16av


i was trying to do this but the error keeps popping. hope you can help me with this. thanks 🙂

0 Kudos
Message 12 of 18

Hi ceciliap004,


I have a question, is the Folder path to were all your images are stored called ",lk;tkw;lk.jpg" ?


If that is not the case, then the error is actually comming from what you are setting in the Path control.

There you just have to set the path to the folder. if this is not the path to the folder: C:\\Users\nico\Pictures\,lk;tkw;lk.jpg.

What you can do is actually set the path as C:\\Users\nico\Pictures\, and the List will look for all the .jpg files inside that folder and output an array (filenames), with all the images names on the folder.


So in  the loop is where you are taking the filenames array and building the path to each image.


Please let me know how it goes.








0 Kudos
Message 13 of 18

Hi carolina,

the name ,lk;tkw;lk.jpg is the filename of a picture file inside the folder  C:\\Users\nico\Pictures\

i was just trying to choose the folder but it just open the folder. so i just chose a picture within the folder.


hope you can still help me. thanks



0 Kudos
Message 14 of 18

You need to set your file path to just select folders.


You can't pick a file in that control because the List Folder function can't work on a file.  It can only work on a folder.  It then returns a list of files that are *.jpg then appends each of those filenames to the folder path.


If you are just trying to pick a single file, then eliminate everything you've shown because that was the solution to your original question of how to go through all the files within your folder.



0 Kudos
Message 15 of 18

Hi ceciliap004,


As RavensFan said, the path should just be the Folder were your pictures are. Then the List Folder function will set a string array with all the names of the .jpg files you have in that folder.






0 Kudos
Message 16 of 18

hi carolina and Ravensfan


thanks a lot guys i got my vi running. just like you said i just put the path of the folder where the pictures are. 

0 Kudos
Message 17 of 18

by the way this what i was trying to do. also i hope you can still help me with this. i would like to put LED indicators that would light whenever the path corresponding to it is shown. like if the path contains 1.jpg LED 1 would light. im used to text based programming so i was thinking that if i could output index array (nth order of the image file in the folder) i could just put some boolean condition for the LED when i tried it a file path indicator appeared. is what im trying to do makes sense or is there a better way to do it?


thank you so much guys. i know youve helped me enough but i hope you could help me again. 🙂

0 Kudos
Message 18 of 18