package movie;
import tool.*;
import java.io.*;
public class pro {
int s,datanumber;
String[] data=new String[50000];
String[] date=new String[50000];
String[] th=new String[50000];
String[] time=new String[50000];
String[] title=new String[500];
int[] rank=new int[500];
int[] pop=new int[500];
int[] seat=new int[500];
public static void main(String[] args) {
pro re=new pro();
}
pro(){
int tr=1;
for(tr=1;tr<1927;tr++){
readfile sub=new readfile();
sub.makedata("data/"+tr+".txt","UTF-8");
data=sub.data;
datanumber=sub.datanumber;
String[] x=data[1].split("</li>");
time[tr]=x[1].replace("<li>","");
date[tr]=x[0];
th[tr]="";
int p1=date[tr].indexOf("[");
int p2=date[tr].indexOf("]",p1);
if(p1>-1)th[tr]=date[tr].substring(p1+1,p2);
p2=-1;
p1=date[tr].indexOf(":");
if(p1>-1) p2=date[tr].indexOf("(",p1);
if(p2>-1)date[tr]=date[tr].substring(p1+1,p2);
for(s=3;s<datanumber;s++){
data[s]=data[s].replace(" ","△");
data[s]=data[s].replace("*","");
}
writexml("gdata/"+tr+".txt");
}
writeindex("ren.csv");
}
void writexml(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
for(s=3;s<datanumber;s++){
pw.print(s-2);
pw.print("△");
pw.println(data[s]);
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
void writeindex(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
for(s=1;s<1927;s++){
pw.print(th[s]);
pw.print(",");
pw.print(date[s]);
pw.print(",");
pw.println(time[s]);
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
int numx(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
}
最終更新:2016年07月03日 12:23