Importing / Xlsread: How to replace unknown character?

3 ビュー (過去 30 日間)
Hampus
Hampus 2017 年 5 月 3 日
コメント済み: Hampus 2017 年 5 月 4 日
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
Walter Roberson 2017 年 5 月 4 日
What is the file extension? Is it a .csv, or a .xls, or a .xlsx ?
Hampus
Hampus 2017 年 5 月 4 日
It is xls

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

回答 (1 件)

Santhana Raj
Santhana Raj 2017 年 5 月 4 日
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.

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by