how to find specific string out of a list in an excel

6 views (last 30 days)
file = read('file');
pattern = strcmp('9',file);
row = find(pattern==1);
Ihaveaquest on 8 Aug 2022
yes and yes yes yes yes to all .. csv file with 1000lines but theres a column with value 9 and 17 that i need the full like row info
thank you

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 8 Aug 2022
data = readtable('FileNameGoesHere');
mask = data{:,ColumnNumberGoesHere} == 9;
subset = data(mask,:);
writetable(subset, 'sampletable.txt');
Image Analyst
Image Analyst on 8 Aug 2022
@Juan you again forgot to attach your data file and say what string pattern you're looking for. So that leads me to believe you did not read the Community Guidelines or Tutorial.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!