アットウィキロゴ

999gklk

package c2;
 
import tool.*;
 
public class pro {
 
 
    int s,datanumber;
    String[] data=new String[60000];
  String[] code=new String[60000];
     String[] pref=new String[60000];
    double[] v=new double[60000];
    int[] year=new int[6000];
      String[] credit=new String[60000];
   String[] bus=new String[60000];
         String[] dic=new String[60000];
         String[] ken=new String[60000];
 
         String[] subdata=new String[60000];
            String[] delta=new String[60000];
 
    public static void main(String[] args) {
        pro t=new pro();
    }
    pro(){
 
        int tr;
int n=1;
 
subdata[1]="y,p,b,code,v";
 
 
int number=0;
 
        for(tr=1;tr<322;tr++){
 
    readfile sub=new readfile();
   sub.makedata("gdata/"+tr+".txt","UTF-8");
   data=sub.data;
   datanumber=sub.datanumber;
 
   for(s=1;s<datanumber+1;s++){
   catchword sub2=new catchword();
bus[s]=   sub2.makedata(data[s],"bus");  
pref[s]=   sub2.makedata(data[s],"pref"); 
credit[s]=   sub2.makedata(data[s],"credit"); 
String str=sub2.makedata(data[s],"year"); 
year[s]=numx(str);
str=sub2.makedata(data[s],"value"); 
v[s]=num(str);
   }
 
   int h,sx,dicnumber=0;
 
for(s=1;s<datanumber+1;s++){
h=0;
for(sx=1;sx<dicnumber+1;sx++){    
if(pref[s].equals(dic[sx]))h=100;
}
if(h<50)dicnumber=dicnumber+1;
if(h<50)dic[dicnumber]=pref[s];
}
 
for(s=1;s<datanumber+1;s++){
h=0;
for(sx=1;sx<dicnumber+1;sx++){    
if(pref[s].equals(dic[sx]))ken[s]="p"+sx;
}
}
 
 
for(s=1;s<datanumber+1;s++){
h=0;
for(sx=1;sx<number+1;sx++){    
if(bus[s].equals(code[sx]))h=100;
}
if(h<50)number=number+1;
if(h<50)code[number]=bus[s];
}
 
for(s=1;s<datanumber+1;s++){
h=0;
for(sx=1;sx<number+1;sx++){    
if(bus[s].equals(code[sx]))delta[s]="c"+sx;
}
}
 for(s=1;s<datanumber+1;s++){
 if(credit[s].indexOf("③")>-1)n=n+1;
  if(credit[s].indexOf("③")>-1)subdata[n]=year[s]+","+ken[s]+","+bus[s]+","+delta[s]+","+v[s];    
 }  
 
    }
 
 
   writefile x=new writefile();
   x.data=subdata;
   x.datanumber=n;
   x.makedata("ren.csv");
 
 
 
 
 
 }
 
 
     int numx(String str){
 
    int nx;
 
    nx=0;
 
 try{
 
    nx=Integer.parseInt(str);
 
 }catch (Exception e) {}
 
 return nx;
 
 
 
}
 
 
 
 
 
double num(String str){
 
    double nx;
 
    nx=0;
 
 try{
 
    nx=Double.parseDouble(str);
 
 }catch (Exception e) {}
 
 return nx;
 
 
 
}
 
 
}
最終更新:2016年06月10日 01:20