Find value(string) in specific line
2 views (last 30 days)
Show older comments
Hi, I attached example like below. And I want to get a value in #cup. In Example, It gonna be 332.
a=12345
apple= 3333
sky=2412
#cup = 332
#water=827
#paper=099
I have many data so I can't get these values by click respectively .
Additionaly, #cup is in different line by data. So i can't find the value if I use find(example(4,:))
Can I get values in #cup using matlab?
0 Comments
Accepted Answer
KSSV
on 31 Aug 2022
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1112505/Example.txt') ;
idx = contains(T.(1),'cup') ;
T(idx,:)
find(idx)
More Answers (1)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!