Search string and get its position in excel using Actxserver

조회 수: 2 (최근 30일)
Ghenji
Ghenji 2018년 3월 7일
댓글: Ghenji 2018년 3월 8일
Is it possible to search for a string in an excel file from particular sheet and also get its position. I need to get data only from this column. So if the position is known, data from that column can be imported. for ex..
fullname = 'C:\Users\Documents\MATLAB\files\food_raw.xlsm;
sheet = 'kharif';
string = 'cotton';
I want to import data present in column "cotton".

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2018년 3월 7일
I will just read the Excel file anyway and search the Raw data.
[Num,Txt,Raw]=xlsread(fullname,sheet);
Or, if 'cotton' is supposed to appear in the first row as the header, you might want to consider readtable() function and put your data in a Table.
  댓글 수: 1
Ghenji
Ghenji 2018년 3월 8일
xlsread might be time consuming if I want to read many excel files with sheet "kharif". Now I have the keyword If I can go to that position and then read whole column below would indeed save time. Cotton is not a header so that doesn't help. Anyway Thank you for your suggestion.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by