package hot2;
import tool.*;
import java.io.File;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] name=new String[50];
String[] point=new String[50];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
File f=new File("data");
String[] ff=f.list();
int trs;
for(trs=1;trs<91;trs++){
System.out.println(trs);
readfile sub=new readfile();
sub.makedata("data/"+ff[trs],"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
int n=0;
int tr;
for(tr=1;tr<5;tr++){
String str=data[tr];
System.out.println(str);
int sx;
String[] x=str.split("</li>");
for(s=0;s<10;s++){
String[] x1=x[s].split("</div>");
String z=clean_str(x1[1]);
z=z.replace(" ","△");
int k;
for(k=1;k<100;k++){
z=z.replace("△△","△");
}
n=n+1;
String[] x3=z.split("△");
name[n]=x3[1];
point[n]=x3[2];
System.out.println(point[n]);
}
}
datanumber=40;
for(s=1;s<datanumber+1;s++){
data[s]=name[s]+","+point[s];
}
writefile su=new writefile();
su.data=data;
su.datanumber=datanumber;
su.makedata("gdata/"+ff[trs]);
}
}
String clean_str(String str){
int m;
String strx=str;
for(m=1;m<15;m++){
strx=fresh(strx);
}
strx=strx.replace(" ","");
strx=strx.replace(" ","");
strx=strx.replace(";","");
return strx;
}
String fresh(String str){
int p1=str.indexOf("<");
int p2=str.indexOf(">",p1);
String sp="";
if(p1>-1)sp=str.substring(p1,p2+1);
String k=str.replace(sp,"");
return k;
}
}
最終更新:2018年02月07日 13:31