Hi Aiman,
It is my understanding that it is required to display all the rows in the table, where any column matches with the input keyword.
Here, I have implemented the same using ‘readtable’ function ’ in MATLAB R2023a on a sample csv file.
In the below code, itis iterating over the rows and storing the row-indices of the table that have any column matching the given token.
in = 'Calcuta';
raw = readtable('sample_sheet.csv')
rowNum = [];
p=1;
for i=1:size(raw)
if ismember(in,raw{i,:})
rowNum(p)=i;
p=p+1;
end
end
tab = readtable('sample_sheet.csv');
% the row at which the input str matches the first table's column
tab(rowNum, :)
Note: For numerical value, use ‘ismember(in,raw(i,:))’.
For more details on the ’readtable’, kindly go through the following documentation