アットウィキロゴ

p000jh

package neko5;
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];
           int[] y1=new int[19000];
             String[] sta=new String[19000];
  int[] m1=new int[19000];
 
    public static void main(String[] args) {
       pro te=new pro();
    }
    pro(){
 
 
 
        readx("d.txt");
 int tr;
 
    int s;
    int sx=0;
    for(s=2;s<datanumber+1;s++){
    int h=0;
    if(data[s].indexOf("火曜日")>-1)h=h+1;
    if(h==1)sx=sx+1;
    if(h==1)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 n2=numx(x[3]);
   int m1=numx(x[5]);
    int m2=numx(x[6]);
   double x1=n1+0.01*n2;
   double x2=m1+0.01*m2;
   int h=0;
   if(x1<8.1)h=h+1;
   if(x2>8.1)h=h+1;
   if(h==2)sx=sx+1;
   if(h==2)subx[sx]=subdata[s];
    }
 
     number=sx;
 
 
   for(s=1;s<number+1;s++){
     String[] x=subx[s].split(",");
     sta[s]=x[1];
     point[s]=x[4];
     String d=x[0];
     d=d.replace("年", "△");
      d=d.replace("月", "△");
       String[] y=d.split("△");
   y1[s]=numx(y[0]);
   m1[s]=numx(y[1]);
       System.out.println(y[0]+","+y[1]);   
   }
 
  for(sx=1;sx<number+1;sx++){
  System.out.println("x["+(sx-1)+"][0]=\""+sta[sx]+"\";");  
  }
 
    for(sx=1;sx<number+1;sx++){
    System.out.println("x["+(sx-1)+"][1]=\""+point[sx]+"\";");  
    }
 
 
    for(sx=1;sx<number+1;sx++){
    System.out.println("x["+(sx-1)+"][2]=new Date("+y1[sx]+","+(m1[sx]-1)+",1"+");"); 
    }
 for(sx=1;sx<number+1;sx++){
  System.out.println("x["+(sx-1)+"][3]=new Date("+y1[sx]+","+(m1[sx]+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月29日 00:39