reading a text file

조회 수: 1 (최근 30일)
Muhammet Ayanoglu
Muhammet Ayanoglu 2012년 1월 1일
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