My goal is to find the column number of the variables stored in my Excel file. Below is my code. Now B stores the column headers. For example B{1,1} is the first variable name, B{1,2} is the second header name, and so on.
% --- load the file ---
File1 = ['workingFolder/abc.xlsx'];[A, B C] = xlsread (File1); % B stores the column headers of my Excel file
How do I write a program so that B{N,2} (N is the number of the column I'm hoping to get) would meet the below searching criteria :
a) It has to contain both string1 and string2.
b) N is the first column meeting that criteria.
For example, a column header with the name of 'ABCDEFG_GKLM' would meet the search criteria of having both 'BCD', and 'KL' in the term.
Many thanks!
Best Answer