Tab key reading problem

3 ビュー (過去 30 日間)
Sergio Vez
Sergio Vez 2019 年 10 月 29 日
編集済み: Shivam Prasad 2019 年 11 月 5 日
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 件のコメント
Sergio Vez
Sergio Vez 2019 年 10 月 29 日
With 8896 it said
Error using fopen
The encoding 'ISO-8896-1' is not valid.
I changed it to ISO-8859-1 but yet not working. It puts a different symbol but not the tab key yet.
Sergio Vez
Sergio Vez 2019 年 10 月 29 日
Could you help me please?

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

採用された回答

Shivam Prasad
Shivam Prasad 2019 年 11 月 5 日
編集済み: Shivam Prasad 2019 年 11 月 5 日
Hi Sergio,
Check if this works for you.
s=importdata('inp.txt')
filePh = fopen('outp.txt','w');
fprintf(filePh,'%s\n',s{:});
fclose(filePh);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by