Movefile with variable file names

10 visualizaciones (últimos 30 días)
gosox2017
gosox2017 el 20 de Mzo. de 2017
Comentada: gosox2017 el 20 de Mzo. de 2017
After an excel file is pulled from a webpage it saves to my downloads. I want to pull this file into a different folder and then run readtable(). My issue is the file has a date in it so the file name changes every day. Is there a way to use a variable filename in a path in a movefile call? ie. d = datetime('today','format','MM-dd-yyyy'); fileName = strcat('Stock List(',char(d),').xls'); movefile user\blah\downloads/(fileName) users\blah\destination
If this doesn't work how can I use readtable with a path to the file. xlsread() messes with the tables formatting. Thanks!

Respuesta aceptada

Adam
Adam el 20 de Mzo. de 2017
Editada: Adam el 20 de Mzo. de 2017
Use the function syntax of movefile to use a variable...
movefile( source, destination );
  1 comentario
gosox2017
gosox2017 el 20 de Mzo. de 2017
Awesome, thanks Adam! That works great!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Files and Folders 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