アットウィキロゴ

c435

package keiki;
 
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
 
 
public class pro {
 
    int maxx,maxy;
 
      String[][] mat=new String[500][700]; 
      String[][] data=new String[500][10];
      int[] year=new int[500];
      int[] month=new int[500];
        String[] credit=new String[500];
        String[] code=new String[500];
        String[] pref=new String[500];
      int s,sx;
    int fastline,lastline;
  int tr;
     String[] code_sex=new String[500];
 
    public static void main(String[] args) {
        pro test=new pro();
    }
 
    pro(){
 
 
        pref[1]="北海道";
pref[2]="青森";
pref[3]="岩手";
pref[4]="宮城";
pref[5]="秋田";
pref[6]="山形";
pref[7]="福島";
pref[8]="茨城";
pref[9]="栃木";
pref[10]="群馬";
pref[11]="埼玉";
pref[12]="千葉";
pref[13]="東京";
pref[14]="神奈川";
pref[15]="新潟";
pref[16]="富山";
pref[17]="石川";
pref[18]="福井";
pref[19]="山梨";
pref[20]="長野";
pref[21]="岐阜";
pref[22]="静岡";
pref[23]="愛知";
pref[24]="三重";
pref[25]="滋賀";
pref[26]="京都";
pref[27]="大阪";
pref[28]="兵庫";
pref[29]="奈良";
pref[30]="和歌山";
pref[31]="鳥取";
pref[32]="島根";
pref[33]="岡山";
pref[34]="広島";
pref[35]="山口";
pref[36]="徳島";
pref[37]="香川";
pref[38]="愛媛";
pref[39]="高知";
pref[40]="福岡";
pref[41]="佐賀";
pref[42]="長崎";
pref[43]="熊本";
pref[44]="大分";
pref[45]="宮崎";
pref[46]="鹿児島";
pref[47]="沖縄";
 
 
        maxx=100;
        maxy=100;
 
 
    readxls sub2=new readxls();
    sub2.maxx=maxx;
    sub2.maxy=maxy;
    sub2.makedata("map.xls",0);
    mat=sub2.mat;
 
    int n,nx;
 
   for(s=1;s<11;s++){
   for(sx=1;sx<16;sx++){
   nx=0;
   for(n=1;n<48;n++){
   if(mat[s][sx].indexOf(pref[n])>-1)nx=n; 
   }    
   if(nx>0)System.out.println(s+","+sx+","+mat[s][sx]+",p"+nx); 
   }
   }
 
 
 
 
 
 
    }
 
 
 
 
    void writexml(String file){ 
 
    int s,sx;
 
try{ 
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file))); 
 
for(s=fastline;s<lastline+1;s++){  
for(sx=5;sx<23;sx++){ 
pw.print("<year>"); 
pw.print(tr+2000); 
pw.print("</year>"); 
pw.print("<pref>"); 
pw.print(pref[s]); 
pw.print("</pref>"); 
pw.print("<sex>");
pw.print(code_sex[s]);
pw.print("</sex>"); 
pw.print("<credit>");
pw.print(credit[sx]);
pw.print("</credit>"); 
pw.print("<value>");
pw.print(mat[s][sx]); 
pw.println("</value>");
}
}
 
 
System.out.println("ファイルに書きこみました。"); 
pw.close(); 
} catch(IOException ep){ System.out.println("入出力エラーです。"); } 
 
 
} 
 
 
 
void writehtml(String file){ 
 
    int s,sx;
 
try{ 
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file))); 
 
 
pw.println("<html>");
 
pw.println("<head>");
pw.println("<meta charset=\"UTF-8\">");
pw.println("</head>");
pw.println("<body>");
pw.print("<table rules=\"all\">"); 
pw.print("<tr>"); 
pw.print("<td>"); 
pw.print(""); 
pw.print("</td>"); 
for(sx=1;sx<maxx+1;sx++){ 
pw.print("<th>"); 
pw.print(sx); 
pw.print("</th>"); 
} 
pw.println("</tr>"); 
for(s=1;s<maxy+1;s++){ 
pw.print("<tr>"); 
pw.print("<th>"); 
pw.print(s); 
pw.print("</th>"); 
for(sx=1;sx<maxx+1;sx++){ 
pw.print("<td>"); 
pw.print(mat[s][sx]); 
pw.print("</td>"); 
} 
pw.println("</tr>"); 
}   
pw.println("</table>"); 
pw.println("</body>");
pw.println("</html>");
 
System.out.println("ファイルに書きこみました。"); 
pw.close(); 
} catch(IOException ep){ System.out.println("入出力エラーです。"); } 
 
 
} 
 
 
 
}
 
最終更新:2015年09月29日 15:17