アットウィキロゴ

p0999fg

package delta;
 
import tool.*;
import java.io.*;
 
public class pro {
 
    int s,datanumber;
String[] data=new String[5000];
String[] pref=new String[5000];
 String[] subdata=new String[500000];
 
int[] year=new int[5000];
int[] age=new int[5000];
int[] credit=new int[5000];
String[] v=new String[5000];
 
public static void main(String[] args) {
        pro r=new pro();
    }
    pro(){
 
        int sx=0;
 
        int tr=10;
 
        for(tr=1;tr<131;tr++){
 
         readfile sub=new readfile();
        sub.makedata("gdata/"+tr+".txt","UTF-8");
        data=sub.data;
        datanumber=sub.datanumber;
 
String str;
 
        for(s=1;s<datanumber+1;s++){    
        catchword sub2=new catchword();
        str=sub2.makedata(data[s],"year");
        year[s]=numx(str);
        str=sub2.makedata(data[s],"age");
        age[s]=numx(str);
        str=sub2.makedata(data[s],"code_credit");
        credit[s]=numx(str);
        pref[s]=sub2.makedata(data[s],"pref");
        v[s]=sub2.makedata(data[s],"value");
        }
 
 
 
for(s=1;s<datanumber+1;s++){
pref[s]=pref[s].replace(" ","");
sx=sx+1;
subdata[sx]=year[s]+","+pref[s]+","+age[s]+","+credit[s]+","+v[s];
}
 
 
        }
 
datanumber=sx;
 
writexml("ren.csv");
 
 
 
 
 
 
    }
     int numx(String str){
 
    int nx;
 
    nx=0;
 
 try{
 
    nx=Integer.parseInt(str);
 
 }catch (Exception e) {}
 
 return nx;
 
 
 
}
 
     void writexml(String file){ 
 
    int s,sx;
 
try{ 
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file))); 
 
 
for(s=1;s<datanumber+1;s++){  
pw.println(subdata[s]);
}
 
 
System.out.println("ファイルに書きこみました。"); 
pw.close(); 
} catch(IOException ep){ System.out.println("入出力エラーです。"); } 
 
 
} 
 
 
 
}
 
最終更新:2016年07月20日 09:40