11-01-2023 10:47 AM
8Buongiorno a tutti.
Sono Nuovo nel ambito labview e mi serve il vostro aiuto gentilmente.
Devo creare un folder con nome che scelgo io ,poi spostare 3 file da una cartella che si trova in un percorso e inserirla nel file appena creato.
Ogni volta devo fare questa operazione con un folder diverso.
Sono riuscito a creare un folder e spostare soltantoun file nel folder predefinita , non con l'ultimo folder che ho creato io, e non con i 3 file
Non so cosa manca e come fare.
Grazie
Solved! Go to Solution.
11-01-2023 11:00 AM
You only show us pictures of some code fragments, one with a greedy while loop and one with a top-level event structure. We cannot debug pictures.
To get help, you need to attach your VI and explain how you use it, what happens, and what you expect to happen instead.
11-01-2023 02:11 PM
Good morning everyone. I am new to labview and need your help kindly. I have to create a folder with a name that I choose, then move 3 files from a folder located in a path and insert it into the newly created file. Every time I have to do this operation with a different folder. I was able to create a folder and only move one file into the default folder, not with the last folder I created, and not with the 3 files I don't know what's missing and how to do it. Thank you
11-01-2023 02:53 PM - edited 11-01-2023 02:55 PM
Hi AM,
@A.M.k1984 wrote:
I was able to create a folder and only move one file into the default folder, not with the last folder I created, and not with the 3 files I don't know what's missing and how to do it. Thank you
There is only one Move operation - and it is even missing its target path…
When you want to Move/Copy 3 files then you need to call Move/Copy trice: use a loop to iterate over an array of filenames!
Did you read the help for all the functions you use?
(Btw. it is quite annoying for seasoned LabVIEW users to see labels above functions. Please make them invisible and use the context help window to read/learn the function names!)
11-01-2023 03:18 PM
Also, if you have multiple events, you probably want a toplevel loop. I really hope you are not using the "continuous run" button for this!
Where do you define the three files? Do they always have the same name?
Also:
11-02-2023 05:29 AM
Thank you , i will try
11-02-2023 05:31 AM
Thank you very much.
I wil try later.
11-02-2023 09:36 AM
I will explain it in other way :
1 . I want to creat a folder name with SN12345 .
2. I want to move 3 files (.amcd,,aban,.txt) to the folder already created Sn12345.
Then I will repeat the operation with other different SN .... but with the same file .
Then when i creat the last foldere , i must move the 3 file in the last folder created.
i don't konw how to make it .
The file found in a path and the folder in another path
Thank you
11-02-2023 09:54 AM
@A.M.k1984 wrote:1 . I want to creat a folder name with SN12345 .
2. I want to move 3 files (.amcd,,aban,.txt) to the folder already created Sn12345.
So is the only user input is the folder name? E.g. a string control where he enters "SN12345"?
What are the full names of these three files? Do they match the folder name, e.g.:
Something else?
What should happen if some of these files don't exist? (error? Ignore?)
11-02-2023 10:19 AM - edited 11-02-2023 11:11 AM
Here's a simple example that created a folder based on SN and moves three file matching the SN to the folder: The files are expected to be in the same folder as the VI, but you can easily expand that.
You don't need to test if the folder already exists, just ignore the error if it does (assuming that there won't be a existing file with that name). We also ignore errors if the move does not succeed. You need to expand the code to correctly deal and report all possible error scenarios.
Note that I am using a numeric control for the serial number. This ensure that only valid characters will end up in the folder/file names.