Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Checking whether the word in .txt are also in .txt

조회 수: 1 (최근 30일)
Kim
Kim 2013년 2월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
How do you check if the words in the email.txt are in the lists.txt. Also there are some misspelled words in email.txt so I have to print out misspelled words.
Using elementary functions (fopen, fclose, fgetl, ischar, isempty, lower, find, strcmp, intersect, max, length, sort, input, str2num, fprintf, etc..)
% read in the lists.txt
fid=fopen('lists.txt');
while 1
tline = fgetl(fid);
if ~ischar(tline), break, end
disp(tline)
end
fclose(fid);
% read in the email
fid=fopen('email.txt');
while 1
tline = fgetl(fid);
if ~ischar(tline), break, end
disp(tline)
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2013년 2월 24일
How does this differ from your earlier question at www.mathworks.co.uk/matlabcentral/answers/64602 ?

답변 (1개)

the cyclist
the cyclist 2013년 2월 24일
The ismember() command might be helpful.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by