Tab key reading problem
显示 更早的评论
Good morning,
I'm trying to read in matlab a ".txt" with the following shape
"RechSt.CalculateP_Usage=0¶
RechSt.CalcWithMidTol=0¶
RechSt.ScoringStandard=0¶"
Having a tab key at the end of each line. When I read it with MATLAB it changes to a symbol like � and therefore, when trying to use the saving file in another software, it gives me an error because it doesn't read the symbol � as a tab key (¶).
How could I fix it?
Thanks in advance!
Sergio
6 个评论
Walter Roberson
2019-10-29
Can you attach a sample file (using Attach, not copy and paste), and also show how you are doing the reading?
Sergio Vez
2019-10-29
Walter Roberson
2019-10-29
Everything looks fine to me on my system. I do not observe any problem.
Walter Roberson
2019-10-29
Try changing
fileID = fopen('OUTPUT.txt','wt');
to
fileID = fopen('OUTPUT.txt', 'wt', 'n', 'ISO-8896-1');
It looks to me as if you are getting some UTF-8 encoding happening.
Sergio Vez
2019-10-29
Sergio Vez
2019-10-29
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Standard File Formats 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!