03-04-2020 03:23 AM
Hello everyone,
I have to open a single file from a selected source folder, modifiy it using Notepad and then copy it to a destination folder (usually different from the source one).
Also, I have to back up some files, so I want to be able to select multiple files or to select a whole folder, and then to copy it into another folder. I attach the vi.
I think my coding is redundant, but I need to configure the "copy" objects and the paths in slightly different ways. Any suggestion for a more elegant implementation?
Further, when I try to copy a folder into the same location, even if I select "overwrite" I get an error 7 (I attach the screenshot). Any ideas on this? Thanks
03-04-2020 03:27 AM - edited 03-04-2020 03:31 AM
Try to share the code in LV 2017 or Lower.
Presuming that you will be modifying the programmatically, In that case read the content from the file modify it and save as different file Name, in that case you will have back up file as well as modified file.
Can repeat same for multiple files in a folder as well.
03-04-2020 05:48 AM
I attach the code in v 2016
03-04-2020 05:57 AM
Hi Davide,
@DavideB wrote:
Any suggestion for a more elegant implementation?
Put a wait statement in the loop: no need to spin as fast as possible!
Your Stop button is missing its label: NEVER delete the label of frontpanel elements!
@DavideB wrote:
Further, when I try to copy a folder into the same location, even if I select "overwrite" I get an error 7 (I attach the screenshot).
How are you trying to "copy a folder"?
03-04-2020 06:02 AM
Thanks for your suggestions,
but my point is: there are two case structures, which are pretty much the same, beside the configuration of "browse" options.
Can I someway do with just one case, properly configured?
03-04-2020 08:35 AM
Hi Davide,
@DavideB wrote:
but my point is: there are two case structures, which are pretty much the same, beside the configuration of "browse" options.
Can I someway do with just one case, properly configured?
Use the FileDialog function to browse for files/folders:
Now you have a FileDialog function with a "browse options" input and you programmatically decide which kind of options you allow to browse for…