package ken;
import java.io.File;
import tool.*;
public class pro {
String[] data=new String[50000];
int s,sx,datanumber,tx;
String[] v=new String[50000];
int[] year=new int[5000];
String[] month=new String[50000];
String[] pref=new String[50000];
int number_pref;
String[] dic=new String[50000];
String[] code=new String[5000];
int creditnumber;
String[] creditp=new String[50];
String[] style=new String[50];
int[] strlong=new int[50];
String[][] datax=new String[500000][10];
public static void main(String[] args) {
pro test=new pro();
}
pro(){
creditnumber=4;
creditp[1]="year";
creditp[2]="season";
creditp[3]="bus";
creditp[4]="value";
style[1]="INTEGER";
style[2]="INTEGER";
style[3]="VARCHAR";
style[4]="VARCHAR";
strlong[3]=20;
strlong[2]=10;
String db,tab;
db="inv";
tab="inv";
table sub7=new table();
sub7.credit=creditp;
sub7.creditnumber=creditnumber;
sub7.style=style;
sub7.strlong=strlong;
sub7.makedata(db,tab);
readfile sub77=new readfile();
sub77.makedata("data.txt", "UTF-8");
data=sub77.data;
datanumber=sub77.datanumber;
String str;
for(s=1;s<datanumber+1;s++){
System.out.println(data[s]);
catchword sub8=new catchword();
str=sub8.makedata(data[s],"year");
year[s]=Integer.parseInt(str);
month[s]=sub8.makedata(data[s],"season");
pref[s]=sub8.makedata(data[s],"credit");
str=sub8.makedata(data[s],"value");
v[s]=str;
}
int h;
for(s=1;s<datanumber+1;s++){
h=0;
for(sx=1;sx<number_pref+1;sx++){
if(pref[s].equals(dic[sx]))h=100;
}
if(h<50)number_pref=number_pref+1;
if(h<50)dic[number_pref]=pref[s];
}
for(s=1;s<datanumber+1;s++){
h=0;
for(sx=1;sx<number_pref+1;sx++){
if(pref[s].equals(dic[sx]))code[s]="b"+sx;
}
}
for(s=1;s<datanumber+1;s++){
datax[s][1]=""+year[s];
datax[s][2]=""+month[s];
datax[s][3]=""+code[s];
datax[s][4]=v[s];
}
insert sub5=new insert();
sub5.creditnumber=creditnumber;
sub5.style=style;
sub5.data=datax;
sub5.datanumber=datanumber;
sub5.makedata(db,tab);
for(sx=1;sx<number_pref+1;sx++){
System.out.println("b"+sx+","+pref[sx]);
}
}
}
最終更新:2015年08月15日 07:18