how to access a particular format files from a drive location?

5 vues (au cours des 30 derniers jours)
sandy
sandy le 28 Août 2013
hi.. In my D drive,many folders(app. 50 folders) are there.each having many formats of files.i need to access .zip files alone in each of the folders and move to separate folder..i am stuck here..

Réponses (2)

David Sanchez
David Sanchez le 28 Août 2013
The following will return a struct containing the .zip files in the folder specified by path_to_zip_files:
my_zips = dir('path_to_zip_files\*.zip')
Then,
for k=1:numel(my_zips)
my_zips(k).name
end
returns the names of the .zip files recursively. Adapt the code to your needs.
  1 commentaire
sandy
sandy le 28 Août 2013
this code showing only .zip files in Desktop alone.but many .zip files are there in locations( \test),(\Users) ...i need to access all .zip files in C DRIVE fully,not in particular path,
my_zips = dir('C:\Users\test\Desktop\*.zip');
for k=1:numel(my_zips)
my_zips(k).name
end

Connectez-vous pour commenter.


David Sanchez
David Sanchez le 28 Août 2013
Modifié(e) : Walter Roberson le 4 Sep 2013
  8 commentaires
Walter Roberson
Walter Roberson le 4 Sep 2013
Please show the complete log of the compilation.
sandy
sandy le 5 Sep 2013
Modifié(e) : sandy le 18 Sep 2013
>>
mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler: [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2010b\sys\lcc
[0] None
Compiler: 1
Please verify your choices:
Compiler: Lcc-win32 C 2.4.1 Location: C:\PROGRA~1\MATLAB\R2010b\sys\lcc
Are these correct [y]/n? y
Trying to update options file: C:\Users\test\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2010b\bin\win32\mexopts\lccopts.bat
Done . . .
************************************************************************ Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9 Building with the -largeArrayDims option enables the new API. ************************************************************************

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by