I want to delete all the headerlines and delimiters from the data in the below attached text file
4 次查看(过去 30 天)
显示 更早的评论
Hello Everyone
I want to delete all the headerlines and delimiters from the data in the below attached text file to execute if-else statements on the data of 2nd and 3rd column of the text file . I am able to delete the headerlines and delimiters only from the first 41 cells of the data.
%% Open the text file
fID = fopen('dil_stress_strain.txt','r');
%% Read columns of data according to the format.
stress=textscan(fID,'%n %n %n','headerlines',7,'Delimiter','');
%% Close the text file.
fclose(fID);
Please help!
0 个评论
采纳的回答
Rik
2019-6-24
The best solution is probably to read your entire file as text, then remove the header lines, then parse them with textscan.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!