Converting TXT File --> Matlab --> Excel

5 次查看(过去 30 天)
Frank Lehmann
Frank Lehmann 2020-6-25
评论: Rik 2020-6-25
I have the attached TXT output report file from Digsilent where i want to convert it to a Malab file then pass it onto an Excel file, any ideas on how i can do this?Unfortunately i havent really done too much with file(s) conversions from importing or exporting of the different extension types and from i see is i can start from here.
Any help much appreciated.
fid = fopen('test.txt', 'rt');
data = cell2mat( textscan(fid, '%s%s%f%f', '\t', 'HeaderLines', 1) );
fclose(fid)
The output is basically empty double matrices but no errors?
Any ideas on how to produce the matlab and excel formats?
Regards,
Frank
  1 个评论
Rik
Rik 2020-6-25
How would you like to store this in excel? I think that is the most important question. If you are using Matlab as a tool to convert it to excel, you should keep that goal in mind.
If you want to read your file line by line, you could consider readfile and then parse every line separately.

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by