I want to select an Excel file by it's extension

1 回表示 (過去 30 日間)
Santosh Biradar
Santosh Biradar 2022 年 8 月 10 日
編集済み: Stephen23 2022 年 8 月 10 日
Hi
%% Here only 1 Excel file will be present in ComparySummary folder. And I want select that Excel file with FilePath %%
FilePath = fullfile(pwd,'\CompareSummary\*_*.xlsx');
[~,sheets] = xlsfinfo(FilePath);
But, It is not idenfying *_*, as I am putting it into single quotation marks ' '.
Please let me know what change shall I do here?
Thank you
Please let me know for brief

回答 (1 件)

KSSV
KSSV 2022 年 8 月 10 日
編集済み: KSSV 2022 年 8 月 10 日
%% Here only 1 Excel file will be present in ComparySummary folder. And I want select that Excel file with FilePath %%
FilePath = fullfile(pwd,'\CompareSummary\*.xlsx');
xlFile = dir(FilePath) ;
[~,sheets] = xlsfinfo(fullfile(xlFile(1).folder,xlFile(1).name));
  4 件のコメント
Santosh Biradar
Santosh Biradar 2022 年 8 月 10 日
編集済み: Santosh Biradar 2022 年 8 月 10 日
Previously, I am using FilePath to read abc_2022_Result.xlsx.
How can I get
D:\mydrive\Task8\CompareSummary\abc_2022_Result.xlsx
using XlFile or NEW variable.
[~,sheets] = xlsfinfo(fullfile(xlFile(1).folder,xlFile(1).name));
Here can I get excel file address?
sheets showing the worksheet presnt in abc_2022_Result.xlsx correctly but getting problem with it's address reading pattern.
xlFile =
struct with fields:
name: 'abc_2022_Result.xlsx'
folder: 'D:\mydrive\Task8\CompareSummary'
date: '10-Aug-2022 14:50:33'
bytes: 34137
isdir: 0
datenum: 7.3874e+05
How can I get
D:\mydrive\Task8\CompareSummary\abc_2022_Result.xlsx
[~,sheets] = xlsfinfo(fullfile(xlFile(1).folder,xlFile(1).name));
can I get excel file New variable.?
Thank you
Stephen23
Stephen23 2022 年 8 月 10 日
編集済み: Stephen23 2022 年 8 月 10 日
"How can I get D:\mydrive\Task8\CompareSummary\abc_2022_Result.xlsx using XlFile ..."
new = fullfile(xlFile(1).folder,xlFile(1).name)

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

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by