12-12-2023 01:02 AM
Hi All,
In the following VI, I am getting list of all filenames in a SPECIFIC FOLDER and then trying to add '/' infront of all the filenames using auto-indexing and concatenation but am unable to do so, rather I am getting something like - /abcv.txtgsvsh.txtfile3.txt.
All the files are getting concatenated, My purpose is later to build different paths and loop over all to use data from them..
12-12-2023 01:27 AM
Hi ms6,
you REALLY need to go to those Training resources offered at the top of the LabVIEW board!
Learn about using autoindexing tunnels!
@ms6 wrote:
In the following VI, I am getting list of all filenames in a SPECIFIC FOLDER and then trying to add '/' infront of all the filenames using auto-indexing and concatenation
No need for array size at the FOR loop.
Autoindex the filename array to access each element!
@ms6 wrote:
All the files are getting concatenated, My purpose is later to build different paths and loop over all to use data from them..
Because you don't autoindex, but operate on the complete array in each iteration of that loop…
12-12-2023 01:30 AM
I can't find the training courses, please link them down if you can..
12-12-2023 01:32 AM
How to directly autoindex an array?
12-12-2023 01:39 AM
Just by the way I have enabled autoindexing and its still not working properly and why should I not put array size at N? Aren't we supposed to define number of Iterations in FOR LOOP??? because that is the only difference between WHILE AND FOR LOOPS!!!
12-12-2023 01:57 AM
12-12-2023 02:03 AM - edited 12-12-2023 02:05 AM
Hi ms6,
@ms6 wrote:
Just by the way I have enabled autoindexing and its still not working properly and why should I not put array size at N? Aren't we supposed to define number of Iterations in FOR LOOP???
No, we are not supposed to define the number of iterations by using the N terminal of the loop!
You define the number of iterations of the FOR loop by the number of elements in your input array!
Again: this is BASIC LabVIEW stuff!
@ms6 wrote:
How to directly autoindex an array?
By wiring an array to a FOR loop…
The default setting is to autoindex the array!
@ms6 wrote:
I can't find the training courses, please link them down if you can..
As said before: at the top of the LabVIEW board!
This is what I see AT THE TOP OF THE LABVIEW BOARD:
Don't you see those items below "Learning Center"?
12-12-2023 03:39 AM
@ms6 wrote:
I can't find the training courses, please link them down if you can..
12-12-2023 10:45 AM - edited 12-12-2023 10:57 AM
@ms6 wrote:
Hi All,
In the following VI, I am getting list of all filenames in a SPECIFIC FOLDER and then trying to add '/' infront of all the filenames using auto-indexing and concatenation but am unable to do so, rather I am getting something like - /abcv.txtgsvsh.txtfile3.txt.
All the files are getting concatenated, My purpose is later to build different paths and loop over all to use data from them..
OK, let's back off a little bit. What is your OS? "/" is a path delimiter in linux and it should probably not be used on windows as part of a folder or file name, for example. You only need to worry about path delimiters if you deal with paths as plain strings ("path to string" or "string to path"), which will make you code immediately platform specific and should only be used if you need to call external code.
Using "build path" will automatically insert the correct path delimiter based on the OS and the code will run on windows and linux unchanged, even though the path formats differ greatly.
For example the following will process all *.txt files in a given folder and will work fine on any OS.
You also seem to be operating on datalog files, so make sure to wire the datalog type for "list folder". You don't want to process other files this way!
Based on the small part of the code we can see, it looks like you are not very familiar with LabVIEW at all and there are some glaringly bad parts visible. Can you explain exactly what you are trying to do? Attach your VI and explain typical input values and examples of desired results based on these inputs.