Converting row to column in text file
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jhon Gray
le 24 Mar 2021
Modifié(e) : Walter Roberson
le 24 Mar 2021
I have a text file with annotation like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/560933/image.png)
I want to shift every alphabet in colum form. Like this.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/560938/image.png)
Tried several ways. failed as the import data need comma or semicolor for separation.
Can anyone help with that?
0 commentaires
Réponse acceptée
Walter Roberson
le 24 Mar 2021
Modifié(e) : Walter Roberson
le 24 Mar 2021
%note: output file name must be different than input name for this
%particular version of the code to work.
[fid, msg] = fopen('new_x01.txt', 'w');
if fid < 0; error('Could not open file because "%s"', msg); end
fprintf(fid, '%c\n', fileread('x01.txt'));
fclose(fid);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import and Export dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!