アットウィキロゴ

せいりせいり

package stat;
 
import tool.*;
import java.io.File;
 
 
public class pro {
 
   int s,datanumber;
   String[] data=new String[500];
  String[] subdata=new String[500];
 
    public static void main(String[] args) {
       pro re=new pro();
    }
 
    pro(){
 
    File d=new File("gdata");
    String[] f=d.list();
        int n=0;
        for(n=0;n<f.length;n++){
        readfile sub=new readfile();
        sub.makedata("gdata/"+f[n],"utf-8");
        data=sub.data;
        datanumber=sub.datanumber;
 
        int sx=0;
        for(s=1;s<datanumber+1;s++){
        int p1=data[s].indexOf("dep-time");
        if(p1>-1)p1=data[s].indexOf(">",p1);
        int p2=data[s].indexOf("<",p1); 
        String str="";
        if(p1>-1)str=data[s].substring(p1+1,p2);
        String t=str;
        p1=data[s].indexOf("train-type");
        if(p1>-1)p1=data[s].indexOf(">",p1);
        p2=data[s].indexOf("<",p1); 
        str="";
        if(p1>-1)str=data[s].substring(p1+1,p2);
       String tr=str;
        p1=data[s].indexOf("destination");
        if(p1>-1)p1=data[s].indexOf(">",p1);
        p2=data[s].indexOf("<",p1); 
        str="";
        if(p1>-1)str=data[s].substring(p1+1,p2);
        String gox=str; 
        p1=data[s].indexOf("data-tx=");
        if(p1>-1)p1=data[s].indexOf("\"",p1);
        p2=data[s].indexOf("\"",p1+1); 
        str="";
        if(p1>-1)str=data[s].substring(p1+1,p2);
          if (str.length()>0)sx=sx+1;
        if (str.length()>0)subdata[sx]=t+","+tr+","+gox+","+str;
        }
 
        writefile sub2=new writefile();
        sub2.data=subdata;
        sub2.datanumber=sx;
        sub2.makedata("data/"+f[n]);
 
        }
 
 
 
    }
 
 
}
 
最終更新:2018年02月24日 03:04