Filter löschen
Filter löschen

Converting row to column in text file

5 Ansichten (letzte 30 Tage)
Jhon Gray
Jhon Gray am 24 Mär. 2021
Bearbeitet: Walter Roberson am 24 Mär. 2021
I have a text file with annotation like this
I want to shift every alphabet in colum form. Like this.
Tried several ways. failed as the import data need comma or semicolor for separation.
Can anyone help with that?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Mär. 2021
Bearbeitet: Walter Roberson am 24 Mär. 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);

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by