How to get row index which have my text

조회 수: 3 (최근 30일)
Mekala balaji
Mekala balaji 2020년 1월 14일
댓글: Mekala balaji 2020년 1월 14일
Hi Helo
How are you mekala
what are you doing
where are you going mekala
I want to get the row index if row contains "mekala
I use below code:
fid=fopen("test.txt")
data=fgetl(fid)
idx=strfind(data,'mekala').
idx is showing empty.

답변 (1개)

David Hill
David Hill 2020년 1월 14일
I assume you loaded your text into a cell.
a={'Hi Helo';'How are you mekala';'what are you doing';'where are you going mekala'};
b=strfind(a,'mekala');
  댓글 수: 1
Mekala balaji
Mekala balaji 2020년 1월 14일
first of all, I am unable to read whole content of the file.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by