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 Center および File ExchangeData 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