reading a text file
1 次查看(过去 30 天)
显示 更早的评论
Hello everybody, I'm totally new user of MATLAB. I have a problem about reading a text file. I have a text file which has about 9000 rows. There are strings,numerical values, characters etc. I just want to take some necessary part from the text file. I realise that the necessary part starts the word "1tally". I need to take the 200 rows. There are 3 regions like this. In different location in the text file. But all of the regions starts 1tally and necessary part for me starts this row to the next 200 rows. How can I take these 600 rows from the text file which located on different place in the file??
1 个评论
回答(1 个)
nanren888
2012-1-1
Well, basically you are going to have to program it. Perhaps parse lines & select the lines you need. Maybe start with help textscan It may help if you know what the delimiter is in the file: eg, one space, commas. At the bottom of the help there are listed some other file IO functions that could be of use if textscan's all encompassing way does not suit you for some reason.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!