How can I get the text instead of NaN when using import options for readtable?
10 次查看(过去 30 天)
显示 更早的评论
Dear all,
I'm using readtable to import data from an open inventor file. The file has some delimited text and point cloud data as x,y,z coordinates that I need.
The file for example looks like this:
My code so far only separates all coordinates from the open inventor file.
To separate them I use readtable with following import options:
But now I want to:
- Import the open inventor file as a table (like I do already)
- Find a range that can be defined by a first/last row with a specified text
- Remove all NaN rows in this range to separate the coordinates
- Use finally a n-rows by 3-columns table to continue processing
My problem now:
If I convert the file to a table with the import options from above, I cannot search for the range boundaries I need, because every text element is converted to NaN. How can I get back the original text and search for the specified rows including text?
attached is a text file that is identical to the open inventor file. If you try to reproduce my code, please rename the extention to ".iv" to reproduce the same behaviour.
I'm using Matlab 2020b.
Thank you very much in advance!
3 个评论
dpb
2020-12-16
I suspect you'd be surprised at relative timing between fgetl and calling detectImportOptions, readtable and table2array twice
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Other Formats 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!