04-09-2024 03:35 AM
Hello everyone
i'm doing an internship and i need help with labview programming. i'd like some help. the subject is that i've created a array containing data from an excel file in one column and the second column contains the worksheet to which the data belongs. then i've created a list of folders in a array using the list folder function. these folders have the same names as the data. the problem is that i'd like to compare the two, list folder and column 1 which contains the data and see if it exists i'd like it to be moved to a folder containing the name of the excel tab if not i'll create it.
04-09-2024 04:04 AM
It sounds like you need a For loop, Search 1D array and Check if file/folder exists. 🙂
04-09-2024 06:56 AM
@AymenDZdouar wrote:
Hello everyone
i'm doing an internship and i need help with labview programming. i'd like some help. the subject is that i've created a array containing data from an excel file in one column and the second column contains the worksheet to which the data belongs. then i've created a list of folders in a array using the list folder function. these folders have the same names as the data. the problem is that i'd like to compare the two, list folder and column 1 which contains the data and see if it exists i'd like it to be moved to a folder containing the name of the excel tab if not i'll create it.
Alternatively, simply call Create Folder on all folders, without checking first.
Create Folder will create an error if the folder exists, but who cares? You might actually care, this is somewhat of a hack, but a hack this convenient is acceptable in my book if the pay off is high (you get less code).
After the Create Folder, you know the folder is there (old or new), so you can copy your files...
04-09-2024 07:34 AM
wiebe@CARYA wrote:Create Folder will create an error if the folder exists, but who cares? You might actually care, this is somewhat of a hack, but a hack this convenient is acceptable in my book if the pay off is high (you get less code).
The exact error is error code 10, whose description is "Duplicate Path". In my reuse library, I just create the folder and use Clear Error to ignore code 10. As you said, if I try to create a folder that already exists, I do not care 99.9% of the time.