Read Arabic Text from Excel and print it
조회 수: 3 (최근 30일)
이전 댓글 표시
I read Arabic Text from Excel, I need to print it in text file I can see the value in debugging in variable editor but when I print it in file it printed as symbols
here is the code
[num,txt,raw] = xlsread(file_name,'All','B1:B10');
filO = fopen(fname, 'w');
for im=1:(size(txt,1))
x=cell2mat(txt(im));
fwrite(filO,x)
end
the output file contains the following
ےےے ےےےے ےےےےے ےےے ےےےےے ےےےےےےے ےےے ےےے ےےےےے ےےےےے ےےےےے ےےےےےے
where is the problem please?
댓글 수: 0
채택된 답변
Walter Roberson
2011년 12월 17일
댓글 수: 2
Walter Roberson
2011년 12월 17일
You probably need to open the text file with 'wt' and UTF-8 attributes, and probably need to fprintf() the characters rather than fwrite() them, so that they will be translated to UTF-8.
추가 답변 (1개)
Michael Katz
2011년 12월 17일
It might be matter of encoding, that is fwrite might be using ASCII or windows-1252. Try making the file UTF-8
fid = fopen(fname,'w','n','UTF-8')
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!