Movefile with variable file names

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!

 採用された回答

Adam
Adam 2017 年 3 月 20 日
編集済み: Adam 2017 年 3 月 20 日

3 投票

Use the function syntax of movefile to use a variable...
movefile( source, destination );

1 件のコメント

gosox2017
gosox2017 2017 年 3 月 20 日
Awesome, thanks Adam! That works great!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFiles and Folders についてさらに検索

質問済み:

2017 年 3 月 20 日

コメント済み:

2017 年 3 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by