How do I convert my .asc file to .xlsx file using MATLAB?

11 vues (au cours des 30 derniers jours)
Joswin Leslie
Joswin Leslie le 23 Juil 2018
Commenté : Krithika A le 24 Juil 2018
I have around three lines of words in my "PLC1.asc" file and then data (around 9000 rows and 3 columns) from my measurements. I want to convert this data to excel using MATLAB. Can anyone tell me what function to use?
  1 commentaire
Walter Roberson
Walter Roberson le 24 Juil 2018
Do you need to preserve the lines of words in your output file?

Connectez-vous pour commenter.

Réponses (1)

Krithika A
Krithika A le 24 Juil 2018
An example of one file (you'll need to change it depending on your data structure):
file = 'file.dat';
delim = ' '; % Your delimiter
data = dlmread(file,'delimiter',delim);
filename_out = 'your_excel.xls';
xlswrite(filename_out,data)
  2 commentaires
Walter Roberson
Walter Roberson le 24 Juil 2018
dlmread() cannot normally handle text, unless it is header lines that you tell it to skip, or it is in leading columns that you tell it to skip.
Krithika A
Krithika A le 24 Juil 2018
Oh right. Then sorry Joswin, I'm not going to be useful here.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by