フィルターのクリア

Reading '*.xlsm' files

27 ビュー (過去 30 日間)
Marcus Vinicius
Marcus Vinicius 2023 年 5 月 9 日
回答済み: Sulaymon Eshkabilov 2023 年 5 月 9 日
All of a sudden MATALAB stopped reading .xlsm files \
d = dir('*.xlsm'); %Read xlsm files in current folderPCA_Data_Set
for i = 1:size(d,1)
nom=d(i).name; %find names
nam=nom(1:7); %reduce name (for example from first to 5th character)
rename = strcat(nam,'.xlsm'); %rewrite the name
movefile(d(i).name, rename); %replacement names
end
%% Extracted sensor data
d = dir('*.xlsm');
meanX=[];names=[]; %Create empty arrays for future storage
for i = 1:size(d,1)
nom = d(i).name; %Read name of xlsm file
po=find(nom=='.'); %Search de name
nam=nom(1:po-1); %Extracted the name
opts = detectImportOptions(nom);%Read option for 'nom' matrix
T1 = readtable(nom,opts); %Read xlsm file
Tx = readtable(d(2).name,opts);
[sensors_readings] = extract_into_one_v1_UIUC7(T1);
sensor_all{i} = sensors_readings;
I get this error message...
Error using detectImportOptions (line 266)
Unable to open file 'C:\Users\Marcus Ferreira\Desktop\Ru Enose Data\Data13\Air0000.xlsm'
as a workbook. Check that the file exists, read access is
available, and the file is a valid spreadsheet file.
Error in Enose_Exctraction_code_UIUC (line 46)
opts = detectImportOptions(nom);%Read option for 'nom' matrix
  1 件のコメント
dpb
dpb 2023 年 5 月 9 日
What with the renaming and all, not terribly surprised may have messed something up; nothing here anybody can do without even a single file to look at...but, my experience with such a case is that the file type doesn't match the extension given to it -- Excel won't open a file that is actually a .xlsx or .xls if it is externally renamed to something different. That would be my first guess...

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

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 5 月 9 日
There might be another case that your intended data file(s) is (are) open and cursor is inside the file.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by