package tv6;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] credit=new String[5000];
String[] v=new String[5000];
String title,sta,time,term;
String week,start,end;
String y1,m1,y2,m2;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
for(s=1;s<5050;s++){
readfile sub2=new readfile();
sub2.makedata("data/"+s+".txt","UTF-8");
datanumber=sub2.datanumber;
if(datanumber>2){
memo sub=new memo();
sub.makedata("data/"+s+".txt");
}
}
}
}
package tv6;
import tool.*;
public class memo {
int s,datanumber;
String[] data=new String[5000];
String[] credit=new String[5000];
String[] v=new String[5000];
String title,sta,time,term;
String week,start,end;
String y1,m1,y2,m2;
void makedata(String file){
readfile sub2=new readfile();
sub2.makedata(file,"UTF-8");
data=sub2.data;
datanumber=sub2.datanumber;
title="";
for(s=1;s<datanumber+1;s++){
String[] x=data[s].split(",");
credit[s]="";
v[s]="";
int h=0;
if(x.length==1)h=h+1;
if(title.length()==0)h=h+1;
if(h==2)title=x[0];
if(x.length>1)credit[s]=x[0];
if(x.length>1)v[s]=x[1];
}
sta="";
for(s=1;s<datanumber+1;s++){
if(credit[s].indexOf("制作局")>-1)sta=v[s];
}
term="";
for(s=1;s<datanumber+1;s++){
if(credit[s].indexOf("放送期間")>-1)term=v[s];
}
time="";
for(s=1;s<datanumber+1;s++){
if(credit[s].indexOf("放送時間")>-1)time=v[s];
}
int p1=time.indexOf("曜");
week="";
if(p1>-1)week=time.substring(0,p1+1);
int p2=-1;
if(p1>-1)p2= time.indexOf("-",p1);
start="";
if(p2>-1)start=time.substring(p1+1,p2);
int p3=-1;
if(p2>-1)p3= time.indexOf("(",p2);
end="";
if(p3>-1)end=time.substring(p2+1,p3);
int q1=term.indexOf("年");
y1="";
if(q1>-1)y1=term.substring(0,q1);
int q2=-1;
if(q1>-1)q2=term.indexOf("月",q1);
m1="";
if(q2>-1)m1=term.substring(q1+1,q2);
int q3=term.indexOf("-");
int q4=-1;
if(q3>-1)q4=term.indexOf("年",q3);
y2="";
if(q4>-1)y2=term.substring(q3+1,q4);
int q5=-1;
if(q4>-1)q5=term.indexOf("月",q4);
m2="";
if(q5>-1)m2=term.substring(q4+1,q5);
System.out.print(week+","+title+","+start+","+end);
System.out.print(","+sta+",");
System.out.println(y1+","+m1+","+y2+","+m2);
}
}
最終更新:2016年07月21日 15:25