Clear Filters
Clear Filters

Converting TXT File --> Matlab --> Excel

2 views (last 30 days)
Frank Lehmann
Frank Lehmann on 25 Jun 2020
Commented: Rik on 25 Jun 2020
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 Comment
Rik
Rik on 25 Jun 2020
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.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!