text to excel for GRIMM data
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a following data, of GRIMM instrument (11D model). The output text file is very complex. I want to convert into an excel file so that i can proceed with the visualization of data.
One file is attached here for the reference.
4 commentaires
dpb
le 9 Sep 2023
Modifié(e) : dpb
le 10 Sep 2023
You been just sitting since June for somebody else to do your work for you????
You haven't supplied enough specifics about what you really want/need to provide exact code; what, specifically would you expect an output file/dataset to look like?
There's some confusion about the file content itself...what are the header columns and how do they relate to the records without that many values?
There are sets of four 8-valued records, but they're not labelled consistently; what's the difference between upper and lower case C0 and c0 -- or is it just some anomaly/error in the file construction? And, is there any significance to the the trailing ":" vis a vis ";"?
Then, it starts off with a P, K, P, then a different sequence following P; whassup with that? Not to mention what may be a date/time stamp(?) in the P record initially has _23 whereas is 23 in the rest...such anomalies add to the difficulties in parsing, but it's essentially impossible without knowing what it is that are looking at and what is expected.
Basically, in such cases, one has to read the data by record and parse/rearrange it into the desired format
ADDENDUM: I intended to add, if this file is output by some commercial package, see the vendor's website for tools to read the output file. Oftentimes (at least with the major vendors) there is a MATLAB version already. Or, you may have the option to mex a C function.
Réponses (1)
Sulaymon Eshkabilov
le 10 Sep 2023
There are a few good MATLAB functions that can be employed to import your data into MATLAB and then export into MS Excel (.xls, xlsx or .csv) format.
For data import: readtable(), dlmread(), textscan(), etc.
For data export: writetable(), writematrix(), xlswrite(), etc.
2 commentaires
dpb
le 10 Sep 2023
Modifié(e) : dpb
le 10 Sep 2023
The problem here isn't the reading, it's the parsing of what has been read to make something useful out of it to write...and there are too many imponderables w/o more input from the OP as to what stuff really is and how/what intends/needs to do with it to take time first...
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!