How to upload data from a .cnv file?
11 views (last 30 days)
Show older comments
I am trying to upload data from a .cnv file that has header lines and then multiple lines of data. I attempted to use readtable but it could not open the file because it was .cnv I uploaded a screenshot of what some of the data looks like as well as a text version of the data
0 Comments
Answers (1)
Cam Salzberger
on 27 Jun 2017
Hello Andrea,
I highly doubt that readtable failed because it is a CNV file. readtable assumes everything you give it to be a text or spreadsheet file, and it interprets accordingly. I believe that the issue is because you have so many header lines, and I believe that readtable defaults to assuming either zero or one header line that contains the variable names.
You can explicitly tell readtable to skip a certain number of lines at the beginning of the file by giving it a HeaderLines argument (and also specifying ReadVariableNames to false, because you don't have any of those). Alternatively, you can use the Import Data app to interactively select what data you want. You can then pull the data into the workspace, or generate code to do it automatically.
-Cam
0 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!