Trying to import multiple text files with odd formatting
Ältere Kommentare anzeigen
So I have a years worth of data in the format of the file give and I only need 2 variables but I need to feed that data into Matlab, aside from manually doing so, is there a way to do so? Just reading the .txt file in to Matlab yields an unusable format. Thank you!
4 Kommentare
Jan
am 7 Jun. 2018
Please pot the code you use for "just reading" and share with the readers, what "unusable format" means. Which of the data are needed in which format? What have you tried so far?
Cameron Power
am 7 Jun. 2018
@Cameron Power: You do not have to modify the files. As soon as you define clearly and uniquely, what you want to extract, it is possible to solve with some lines of Matlab code. I do not start to post a solution as long, as I have to guess, what you exactly need.
Do this manually for the posted example input.
Cameron Power
am 8 Jun. 2018
Bearbeitet: Cameron Power
am 8 Jun. 2018
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 7 Jun. 2018
0 Stimmen
See the FAQ for two code snippets to read in multiple files: https://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
In the loop, put your file reading code. It can use csvread(), importdata(), readtable(), or whatever.
1 Kommentar
Cameron Power
am 7 Jun. 2018
Kategorien
Mehr zu Data Import and Export finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!