필터 지우기
필터 지우기

How do you search a file for a matching string?

조회 수: 1 (최근 30일)
Vinay kumar Reddy
Vinay kumar Reddy 2013년 2월 2일
Hi,
I have a huge contacts list in a excel file which consists of following fields
FirstName LastName UserID EmailAddress.
I have FirstName and LastName in MATLAB as a variable.
How do I extract the user ID and EmailAddress for a corresponding FirstName and LastName?
Note:There are some 50,000 contacts in Excel file.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 2일
[num,text,v]=xlsread('yourfile')
s1='firstname';
s2='lastname';
idx=find(strcmp(v(:,1),s1) & strcmp(v(:,2),s2)
Id=v(idx,3)
Email=v(idx,4)

추가 답변 (0개)

카테고리

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