How to get row index which have my text

2 Ansichten (letzte 30 Tage)
Mekala balaji
Mekala balaji am 14 Jan. 2020
Kommentiert: Mekala balaji am 14 Jan. 2020
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.

Antworten (1)

David Hill
David Hill am 14 Jan. 2020
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 Kommentar
Mekala balaji
Mekala balaji am 14 Jan. 2020
first of all, I am unable to read whole content of the file.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by