Filter löschen
Filter löschen

moving files sysntax

1 Ansicht (letzte 30 Tage)
Baba
Baba am 7 Nov. 2011
I would like to move files that start with data- to a folder called data that is in the same directory as the files:
mkdir ('data');
movefile('data-*','data')
having problems with the syntax of the destination folder
  1 Kommentar
David Young
David Young am 7 Nov. 2011
What is the nature of the problem? I can't see anything wrong.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 7 Nov. 2011
Your code should work. The only thing is that you need to run the code in the same folder where those data-* files are resident in because you didn't specify the full path. In other words, your MATLAB current folder needs to be that folder.
  4 Kommentare
David Young
David Young am 8 Nov. 2011
I tried the code too, and it worked fine.
Hastiepen
Hastiepen am 28 Jun. 2012
movefile() will fail if MATLAB doesn't have permission to access the file. For example, after opening a text file in MATLAB to read it, then closing said text file, I found that I could not manually delete the file myself without restarting MATLAB.
A bit of a late answer, I know, but I hope this helps other people!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by