Extracting specific column of values using regexp
1 次查看(过去 30 天)
显示 更早的评论
I am currently trying to extract the X, Y, Z values from a .txt file. Any help is greatly appreciated!
3 个评论
Guillaume
2016-9-6
Rather than a screenshot of a text file (with which we can't experiment), attach an actual file.
回答(1 个)
Guillaume
2016-9-6
Your text file looks fairly ordinary. Matlab shouldn't have much problem importing using one of its many functions. Probably, the simplest would be to use readtable.
Without a file, I can't test but I believe
t = readtable('yourfile', 'HeaderLines, 1, 'Delimiter', 'tab')
should work, assuming you give it the right delimiter.
1 个评论
Stephen23
2016-9-6
@Dhani Dharmaprani: it is usually much faster and simpler to read all of the data, and then use basic MATLAB indexing afterwards to select that data that you need.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!