clc;
inputpath='F:\\ecdict.txt';
outputpath='F:\\test.xls';
fid=fopen(inputpath,'r');
i=1;
word='';
urlword='';
space=0;
k=1;
while(i)
a=fread(fid,1,'char');
if(a~=10)
while(a~=10)
if(a==' ')
space=1;
a=fread(fid,1,'char');
continue;
end
if(space==1)
word=[word,' ',a];
urlword=[urlword,'%20',a];
space=0;
else
word=strcat(word,a);
urlword=strcat(urlword,a);
end
a=fread(fid,1,'char');
end
else
continue;
end
space=0;
%%%%%%%%%%%%%%%%%%%%%%%%%%outputword
url=strcat('http://dict.hujiang.com/em/Android/en/',urlword);
str=urlread(url);
n1=strfind(str,'');
if(~isempty(n1))
n2=strfind(str,'');
n3=strfind(str,'');
n4=strfind(str,'');
n5=strfind(str,'');
para2=str(n1:n2);
para3=str(n2:n3);
para4=str(n4:n5);
pat='"panel_comment">(.*?)