Importing / Xlsread: How to replace unknown character?

3 visualizaciones (últimos 30 días)
Hampus
Hampus el 3 de Mayo de 2017
Comentada: Hampus el 4 de Mayo de 2017
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 comentarios
Walter Roberson
Walter Roberson el 4 de Mayo de 2017
What is the file extension? Is it a .csv, or a .xls, or a .xlsx ?
Hampus
Hampus el 4 de Mayo de 2017
It is xls

Iniciar sesión para comentar.

Respuestas (1)

Santhana Raj
Santhana Raj el 4 de Mayo de 2017
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.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by