package pon;
import tool.*;
import java.io.*;
public class pro {
int s,datanumber;
String[] data=new String[50];
String[] pos=new String[50];
String[] name=new String[50];
String[][] point=new String[50][20];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
readfile sub7=new readfile();
sub7.makedata("1.txt","UTF-8");
data=sub7.data;
datanumber=sub7.datanumber;
int sx;
for(s=1;s<datanumber-1;s++){
for(sx=1;sx<20;sx++){
point[s][sx]="△";
}
}
for(s=1;s<datanumber-1;s++){
String[] x=data[s].split(",");
for(sx=0;sx<x.length;sx++){
if(sx==0)pos[s]=x[sx];
if(sx==1)name[s]=x[sx];
if(sx>7)point[s][sx-7]=x[sx];
}
}
for(s=1;s<datanumber-1;s++){
pos[s]=pos[s].replace("<tr>","");
name[s]=name[s].replace("<td class=\"left\">","");
for(sx=1;sx<20;sx++){
point[s][sx]=point[s][sx].replace(" ","△");
point[s][sx]=point[s][sx].replace("……","△");
}
}
writecsv("ren.txt");
}
void writecsv(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
for(s=1;s<datanumber-1;s++){
pw.print(name[s]);
pw.print(",");
pw.print(pos[s]);
for(sx=1;sx<20;sx++){
pw.print(",");
pw.print(point[s][sx]);
}
pw.println("");
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
}
最終更新:2016年06月21日 01:10