Importing / Xlsread: How to replace unknown character?

조회 수: 1 (최근 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 CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by