Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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

1 visualización (últimos 30 días)
Kim
Kim el 24 de Feb. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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

Respuestas (1)

the cyclist
the cyclist el 24 de Feb. de 2013
The ismember() command might be helpful.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by