How to copy a selective list of files, 'b', 'c' and 'd', from folder A to the folders 'B', 'C' and 'D' respectively.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How to copy a selective list of files, 'b', 'c' and 'd', from folder A to the folders 'B', 'C' and 'D' respectively. Furthermore, I have an additional distinct question. How to open a '.bat' file with the Matlab command and with no further action to be performed in Matlab.
0 Kommentare
Akzeptierte Antwort
Rik
am 18 Aug. 2018
If you have the list of files and target folders, you can use the copyfile function. Running a batch file is as easy as doing this:
example='C:\batch_file.bat';
%example='batch_file.bat';%if the file is in the current folder
%example='C:\folder with space\batch_file.bat';
system(sprintf('"%s"',example));
You can also start it as a parallel process:
system(sprintf('start "%s"',example));
5 Kommentare
Rik
am 21 Aug. 2018
Why don't you try something, and if that fails, explain what you tried, and what the exact rules for your comparison and copy are. I could write an example for you, but it will likely be totally irrelevant for your use case. You know the function you need to use: dir. It returns a struct with several fields. You should be able to write some kind of loop that deals with these files.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!