How can I read unformated text from txt file?
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to read a txt files with annotations in order to process EEG signals. I attach the txt file What I would like to have is something in the lines of a structure or matrix where I could have in the same or different structures the headers and the time. Something along the lines of:
[Occhi aperti , 361.078
Stringe i pugni , 370.859
Rilascia i pugni , 381.031
Occhi chiusi , 405.219
Occhi aperti , 580.797...]
Thank you very much
0 件のコメント
回答 (1 件)
Elizabeth Reese
2017 年 12 月 7 日
I recommend playing around with the Import Tool. I was able to take your file and import it as a table with the first variable being strings with the text from within the [] brackets and the second being a double of the value in the before the "None". To do this, I added custom column delimiters ([, ], and ') to separate the columns from one another and checked "Treat Multiple Delimiters as One" in the delimiter options. I imported the first column as "Text" and the second as a number and named the variables Headers and Time respectively.
Here is what the tool looked like when I was done and what the output was.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Standard File Formats についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!