Printing Devanagari Characters in Notepad via csvwrite

13 ビュー (過去 30 日間)
madhusudan kumar
madhusudan kumar 2015 年 8 月 30 日
コメント済み: snehal gaikwad 2021 年 11 月 10 日
I performed a Devanagari Character Recognition code using neural network.. My codes are working.. Now I have to display the characters in a csv file.. It is possible to print English Characters in a notepad in English.. But I have a task in hand to print the recognized Devanagari text in csv.. Is it even possible..
Thanking you
  2 件のコメント
shilpa jain
shilpa jain 2016 年 2 月 16 日
By using this code you can open a text file and write denagri letters. remember to change font to mangal.
fid = fopen('hindi.txt', 'w'); fwrite(fid, unicode2native(char(hex2dec('0915')),'UTF-8')); fwrite(fid, unicode2native(char(hex2dec('0911')),'UTF-8')); fwrite(fid, unicode2native(char(hex2dec('0917')),'UTF-8')); fwrite(fid, unicode2native(char(hex2dec('0918')),'UTF-8')); fclose(fid)
snehal gaikwad
snehal gaikwad 2021 年 11 月 10 日
how to write kshya, dnya and tra in text file

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

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 8 月 30 日
You will need to open the csv file yourself, and construct the output strings (including comma an newline), convert to UTF-8, add fwrite() the result. For example,
S1 = char(hex2dec('0906'):hex2dec('0918')); %generate some characters
S2 = char(S1+20); %generate some more characters
S = {S1,S2; S2, S1}; %so we have a cell array of string outputs
for K = 1 : size(S,1) %for each line
outcsv = [strjoin(S(K,:),','), '\n']; %in char format
fwrite(fid, unicode2native(outcsv, 'UTF-8'); %fwrite() not fprintf() !
end

Community Treasure Hunt

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

Start Hunting!

Translated by