package base2;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] team_h=new String[5000];
String[] team_v=new String[5000];
String[] code=new String[5000];
String[] name=new String[5000];
String[] team=new String[5000];
String[] code_h=new String[5000];
String[] code_v=new String[5000];
int number;
String[] namex=new String[5000];
String[] teamx=new String[5000];
public static void main(String[] args) {
pro te=new pro();
}
pro(){
readfile sub7=new readfile();
sub7.makedata("p.csv","UTF-8");
data=sub7.data;
datanumber=sub7.datanumber;
int sx=1;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split(",");
int n=numx(x[0]);
int z=0;
if(data[s].indexOf("home")>-1)z=100;
if(z>50)team_h[n]=x[2];
if(z<50)team_v[n]=x[2];
}
for(s=1;s<484;s++){
if(team_h[s].indexOf("ヤクルト")>-1)code_h[s]="ヤクルト";
if(team_h[s].indexOf("中日")>-1)code_h[s]="中日";
if(team_h[s].indexOf("DeNA")>-1)code_h[s]="横浜";
if(team_h[s].indexOf("阪神")>-1)code_h[s]="阪神";
if(team_h[s].indexOf("巨人")>-1)code_h[s]="読売";
if(team_h[s].indexOf("広島")>-1)code_h[s]="広島";
if(team_h[s].indexOf("ソフトバンク")>-1)code_h[s]="福岡";
if(team_h[s].indexOf("日本ハム")>-1)code_h[s]="札幌";
if(team_h[s].indexOf("ロッテ")>-1)code_h[s]="千葉";
if(team_h[s].indexOf("阪神")>-1)code_h[s]="阪神";
if(team_h[s].indexOf("オリックス")>-1)code_h[s]="大阪";
if(team_h[s].indexOf("楽天")>-1)code_h[s]="仙台";
if(team_h[s].indexOf("西武")>-1)code_h[s]="西武";
if(team_v[s].indexOf("ヤクルト")>-1)code_v[s]="ヤクルト";
if(team_v[s].indexOf("中日")>-1)code_v[s]="中日";
if(team_v[s].indexOf("DeNA")>-1)code_v[s]="横浜";
if(team_v[s].indexOf("阪神")>-1)code_v[s]="阪神";
if(team_v[s].indexOf("巨人")>-1)code_v[s]="読売";
if(team_v[s].indexOf("広島")>-1)code_v[s]="広島";
if(team_v[s].indexOf("ソフトバンク")>-1)code_v[s]="福岡";
if(team_v[s].indexOf("日本ハム")>-1)code_v[s]="札幌";
if(team_v[s].indexOf("ロッテ")>-1)code_v[s]="千葉";
if(team_v[s].indexOf("阪神")>-1)code_v[s]="阪神";
if(team_v[s].indexOf("オリックス")>-1)code_v[s]="大阪";
if(team_v[s].indexOf("楽天")>-1)code_v[s]="仙台";
if(team_v[s].indexOf("西武")>-1)code_v[s]="西武";
}
readfile sub=new readfile();
sub.makedata("m.csv","UTF-8");
data=sub.data;
datanumber=sub.datanumber;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split(",");
code[s-1]=x[0];
name[s-1]=x[3];
team[s-1]=x[1];
}
number=datanumber-1;
readfile sub4=new readfile();
sub.makedata("p2.csv","UTF-8");
data=sub.data;
datanumber=sub.datanumber;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split(",");
int n=numx(x[0]);
String k="";
if(x[1].indexOf("visit")>-1)k=code_h[n];
if(x[1].indexOf("home")>-1)k=code_v[n];
namex[s-1]=x[3];
teamx[s-1]=k;
}
for(s=1;s<datanumber;s++){
int sxs=0;
for(sx=1;sx<number+1;sx++){
int h=0;
if(team[sx].equals(teamx[s]))h=h+1;
if(name[sx].indexOf(namex[s])>-1)h=h+1;
if(h==2)sxs=sx;
}
System.out.println(data[s+1]+","+team[sxs]+","+code[sxs]);
}
}
int numx(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
}
最終更新:2016年10月07日 05:06