readtable does not like umlauts in file name

Since R2016 I am not able to open a file with readtable when it contains a german umlaut:
ex =
MException with properties:
identifier: 'MATLAB:spreadsheet:book:fileOpen'
message: 'Unable to open file '/xxxx/Übersichtsliste_Test.xlsm' as a workbook. Check that the file exists, read access is available, and the file is a valid spreadsheet file.'
cause: {0×1 cell}
stack: [3×1 struct]
K>> ex.stack(1)
ans =
struct with fields:
file: '/xxxxx/R2018b/toolbox/matlab/iofun/readtable.m'
name: 'readtable'
line: 216
With R2015b it works.
Do I miss something?

Answers (1)

Hi Corinna,
I understand that you are having trouble importing a file with readtable.
However, I couldn't reproduce your issue on R2016a or R2016b from my end. Here is what I tried:
  • Create an excel file, named as 'Übersichtsliste_Test.xlsm';
  • saved it on my desktop;
  • excuted readtable('Übersichtsliste_Test.xlsm')
Note that readtable imported data in my file correctly.
Please make sure that the file path is correct.

6 Comments

I forgot to mention, that I am running Matlab on a Linux PC. Maybe this makes a difference?
Here is what I did (I used R2018b):
K>> version('-release')
ans =
'2018b'
K>> exist('Übersichtsliste_Test.xlsm')
ans =
2
K>> readtable('Übersichtsliste_Test.xlsm');
Error using readtable (line 216)
Unable to open file
'/proj/xxxx/060_testing/nastran_2016_11_15/glw1/Übersichtsliste_Test.xlsm' as a workbook.
Check that the file exists, read access is available, and the file is a valid spreadsheet file.
K>> [c, ~] = xlsread('Übersichtsliste_Test.xlsm', 'B:B');
Note that xlsread can read the file.
Wenn I rename the file to "Uebersichtsliste_Test.xlsm" then it works:
K>> readtable('Uebersichtsliste_Test.xlsm');
Warning: Variable names were modified to make them valid MATLAB identifiers. The original names are saved in the
VariableDescriptions property.
Is there anything to consider with respect to encoding? These are my locale settings:
K>> system('locale')
LANG=de_DE
LC_CTYPE="de_DE"
LC_NUMERIC=POSIX
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
I just tried this again with R2019b. No difference. I can not read a .xlsm File with 'readtable' which has an umlaut in its filename.
I am running Matlab on a Linux PC.
Stephen23
Stephen23 on 27 Jan 2020
Edited: Stephen23 on 27 Jan 2020
Is the path to the file correct?
Can you fopen the file in matlab? It won't help at all with the actual import but it would tell us if the problem is specific to readtable or more with general IO in matlab.
The path to the file is correct. As I can read the file without problems with 'xlsread'.
>> fopen('Übersicht.xlsm')
ans =
3
I just opened a bug report w/r to this. Sorry, I do not remember the ticket number.
So it is restricted to readtable. Raising a bug report is probably the best way to get the issue resolved.

Sign in to comment.

Products

Release

R2018b

Asked:

on 13 Feb 2019

Commented:

on 27 Jan 2020

Community Treasure Hunt

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

Start Hunting!