removing the text data by only keeping the numerical values
2 次查看(过去 30 天)
显示 更早的评论
I want to remove all the text present before the two columns with numerical values.I have several files like this how can i do it for all the text files at the same time
0 个评论
回答(2 个)
Adam Danz
2021-4-21
2 个评论
Adam Danz
2021-4-22
Those functions are designed to work with text files and other types of files.
Read the documentation, that's why I provided links. There's a bit of a learning curve to using these functions since they have many different options but that's all explained in the documentation along with examples. Walter Roberson's answer shows you how to do this and each of those steps are explained in the links I provided above.
Walter Roberson
2021-4-22
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/592115/D11.csv';
opt = detectImportOptions(filename, 'readvariablenames', false, 'headerlines', 9, 'extracolumnsrule', 'ignore');
t = readtable(filename, opt );
t.Properties.VariableNames = {'X-AXIS', 'Y-AXIS'};
summary(t)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!