Importing / Xlsread: How to replace unknown character?
显示 更早的评论
clearvars;
filename = 'ABB';
[ num,txt,raw ] = xlsread( char(filename) );
Problem with above: how do I replace an unknown character, i.e. a character that's not in the English language when importing from an Excel-file?
E.g. the Swedish letter ö? When I'm screening the document through Matlab I just see a question mark.
2 个评论
Walter Roberson
2017-5-4
What is the file extension? Is it a .csv, or a .xls, or a .xlsx ?
Hampus
2017-5-4
回答(1 个)
Santhana Raj
2017-5-4
0 个投票
Instead of using xlsread, use readtable.
one of its options is fileEncoding. I am sure it can read Swedish, but you can explore in that direction.
another suggestion is to replace '?' with space after reading the whole xls file.
类别
在 帮助中心 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!