Export Excel values and characters to a txt file
Show older comments
Good afternoon,
Please I am trying to export data from Excel in order to write them in a txt file. The Excel file contains values and characters, I tried to use fprintf and dlmwrite but I always have a trouble with the format. Furthermore, I don't know how to use fprintf without replacing what was already present in the txt file.
The result I would like to have is contained in the txt Jeu2.txt (wrote it manually). I copied the colums A1:H10001 then pasted, copied J1:Q10001 then pasted. I need to do this for the 3 sheets.
This is what I have tried so far :
%Creation fichiers .mac
i=1;
Nom_jeux='Bon_Format_Jeu_%d.xlsx';
str = sprintf(Nom_jeux,i);
Bon_Format='Jeu_%d.mac';
New_FORMAT = sprintf(Bon_Format,i);
fid = fopen('New_FORMAT','wt');
fprintf(fid, '!ACCELEROGRAMME HORIZONTALE SELON X POUR LE JEU 1 ');
Bon_Format='Bon_Format_Jeu_%d.xlsx';
str = sprintf(Bon_Format,i);
TAB='A%d:H%d';
A1=1;
A2=10001;
str2=sprintf(TAB,A1,A2);
[num,Temps,Raw]=xlsread(str,'Feuil1',str2);
fprintf(fid,Raw,);
I would be really grateful if someone could help me !
Thanks,
Thibaut
Accepted Answer
More Answers (0)
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!