reading a text file

1 次查看(过去 30 天)
Muhammet Ayanoglu
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 个评论
TAB
TAB 2012-1-2
Please post example of text data, so that we can suggest code for its manipulation.

请先登录,再进行评论。

回答(1 个)

nanren888
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.

类别

Help CenterFile Exchange 中查找有关 Data Import and Export 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by