Read software data files.

1 visualización (últimos 30 días)
Zhanhong
Zhanhong el 5 de Jul. de 2011
I'm dealing with various software data files. When I try to open the files in wordpad there are normal English characters and some wired characters, seems they are all ASCII characters with ANSI number from around 200 to 255. Something look like "ÿÿÿÿ". I think the data must be stored in those characters but I don't know how to read those data into MATLAB since I don't have too much experience with data format handling. Thanks for your help.
  1 comentario
Fangjun Jiang
Fangjun Jiang el 5 de Jul. de 2011
What is your data file look like? How do you want to process it? Just read it as string or do you have some numeric data? You need to specify your question. MATLAB can read ASCII value 200 to 255 characters.
>> char(200:255)
ans =
ÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

Iniciar sesión para comentar.

Respuestas (1)

Rick Rosson
Rick Rosson el 5 de Jul. de 2011
Please try the following:
filename = 'myfile.txt';
txt = fopen(filename,'r');
aStr = fscanf(txt,'%s');
fclose(txt);
ascii = uint8(aStr);
disp(ascii');
HTH.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by