アットウィキロゴ

kasiko

package kayou;
 
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
 
public class pro {
 
     String[] data=new String[90000];
      int datanumber;
 
       String[] subdata=new String[19000];
          String[] subx=new String[19000];
             String[] point=new String[19000];
           String[] date=new String[19000];
             String[] next=new String[19000];
 
 
    public static void main(String[] args) {
       pro te=new pro();
    }
    pro(){
 
 
 
        readx("data.csv");
 
    int s;
    int sx=0;
    for(s=2;s<datanumber+1;s++){
    int h=0;
    if(data[s].indexOf("フジ")>-1)h=h+1;
    if(data[s].indexOf("火曜日")>-1)h=h+1;
    if(h==2)sx=sx+1;
    if(h==2)subdata[sx]=data[s];   
    }
 
    int number=sx;
 
    sx=0;
     for(s=1;s<number+1;s++){
   String[] x=subdata[s].split(",");
   int n1=numx(x[2]);
   int m1=numx(x[5]);
    int m2=numx(x[6]);
   double x1=n1;
   double x2=m1+0.01*m2;
   int h=0;
   if(x1<9)h=h+1;
   if(x2>8.01)h=h+1;
   if(h==2)sx=sx+1;
   if(h==2)subx[sx]=subdata[s];
 
    }
 
     number=sx;
 
    int tx=0; 
    for(s=1;s<13;s++){
    for(sx=1;sx<5;sx++){
    int y1=1997+s;
    int m1=3*sx-2;
    tx=tx+1;
    date[tx]=y1+"年"+m1+"月";
    }    
    } 
 
    int delta=tx;
 
 
    for(s=1;s<number+1;s++){
    String[] x1=subx[s].split(",");
    for(sx=1;sx<delta+1;sx++){
    if(x1[0].indexOf(date[sx])>-1)point[sx]=x1[4];    
    }
    }
 
    for(sx=1;sx<delta+1;sx++){
    System.out.println("x["+(sx+47)+"][0]=\"フジ\";");  
    }
 
    for(sx=1;sx<delta+1;sx++){
    System.out.println("x["+(sx+47)+"][1]=\""+point[sx]+"\";");  
    }
 
    tx=0; 
    for(s=1;s<13;s++){
    for(sx=1;sx<5;sx++){
    int y1=1997+s;
    int m1=3*sx-2;
    tx=tx+1;
   System.out.println("x["+(tx+47)+"][2]=new Date("+y1+","+(m1-1)+",1"+");"); 
    }    
    } 
 
    tx=0; 
    for(s=1;s<13;s++){
    for(sx=1;sx<5;sx++){
    int y1=1997+s;
    int m1=3*sx;
    tx=tx+1;
   System.out.println("x["+(tx+47)+"][3]=new Date("+y1+","+(m1-1)+",28"+");"); 
    }    
    } 
 
 
 
 
 
    }
 
     int numx(String str){
 
    int nx;
 
    nx=0;
 
 try{
 
    nx=Integer.parseInt(str);
 
 }catch (Exception e) {}
 
 return nx;
 
 
 
}
 
    void readx(String file){
 
String str;
BufferedReader br;  
int s;
s=0;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));  
while((str = br.readLine()) != null) {  
s=s+1;
data[s]=str;  
}
br.close();
} catch (IOException e) {System.out.println(e);}  
 
datanumber=s;
 
} 
 
}
最終更新:2016年08月28日 21:22