Converting a human-readable txt file to machine-readable

I extracted some data to a text file to then format in excel but it has read in a human-readable format. Is there a way I can reload my current text file into MatLab and reconvert it to a machine-readable format?

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 11 月 26 日
編集済み: Ameer Hamza 2020 年 11 月 26 日

0 投票

Following loads the values again as numeric form
str = fileread('HourlyBirkenesOzone.txt');
values = regexp(str, '(\d+\.\d+)', 'tokens');
values = str2double([values{:}]);
I am not sure how you created the current file, but if you want to save it properly then use functions such as writematrix() to write file in MS excel format or save() to save in binary format.

質問済み:

2020 年 11 月 26 日

編集済み:

2020 年 11 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by