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

5 visualizaciones (últimos 30 días)
sandy
sandy el 28 de Ag. de 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..

Respuestas (2)

David Sanchez
David Sanchez el 28 de Ag. de 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 comentario
sandy
sandy el 28 de Ag. de 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

Iniciar sesión para comentar.


David Sanchez
David Sanchez el 28 de Ag. de 2013
Editada: Walter Roberson el 4 de Sept. de 2013
  8 comentarios
Walter Roberson
Walter Roberson el 4 de Sept. de 2013
Please show the complete log of the compilation.
sandy
sandy el 5 de Sept. de 2013
Editada: sandy el 18 de Sept. de 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. ************************************************************************

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by