package p6;
import tool.readfile;
import java.io.*;
public class pro {
int s,datanumber;
String[] data=new String[9000];
String point[]=new String[50000];
int rank[]=new int[50000];
String[] t=new String[9000];
String[] sta=new String[9000];
String[] date=new String[9000];
String[] time=new String[9000];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
int tr;
for(tr=1;tr<53;tr++){
readfile sub2=new readfile();
sub2.makedata("gdata/"+tr+".txt","UTF-8");
data=sub2.data;
datanumber=sub2.datanumber;
for(s=1;s<datanumber+1;s++){
String[] x=data[s].split(",");
t[s]=x[0].trim();
sta[s]=x[1].trim();
date[s]=x[2].trim();
int p1=x[3].indexOf(" ");
time[s]=x[3].substring(0,p1);
time[s]=time[s].trim();
point[s]=x[4].trim();
}
writexml("tv/"+tr+".txt");
}
}
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.print(date[s]+",");
pw.print(time[s]+",");
pw.print(sta[s]+",");
pw.print(t[s]+",");
pw.println(point[s]);
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
}
最終更新:2017年01月23日 16:10