Effacer les filtres
Effacer les filtres

Format transformation in .txt

5 vues (au cours des 30 derniers jours)
Sergio Vez
Sergio Vez le 29 Oct 2019
Commenté : Sergio Vez le 4 Nov 2019
Good afternoon,
I made a MATLAB program that enters a ".txt" file, makes some changes on it, and outputs the same ".txt" file with the changes.
The problem is that the IMPUT ".txt" uses a conversion UNIX(LF) and a unicode transformation format UTF-16 LE. But the OUTPUT ".txt" is created by MATLAB with a conversion WINDOWS(CRLF) and an unicode transformation format UTF-8. That makes some symbols or the newline parameter not to be read properly.
How could I fix it?
Thanks in advanced
Sergio
  9 commentaires
Walter Roberson
Walter Roberson le 31 Oct 2019
fileID = fopen('ENTRADA.Z14','rt','n','UTF16-LE');
and on output,
fileID = fopen('OUTPUT.txt', 'wt', 'n', 'UTF16-LE');
ignore the warnings about UTF16-LE not being supported.
There is a way to avoid having the warning generated (rather than ignored) but it involves doing unicode to native transformation. Not impossible by any means, but a bit of a nuisance.
Sergio Vez
Sergio Vez le 4 Nov 2019
Thank you so much! It worked!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Import and Export dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by