package pub;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
String w1="支持する";
String w2="支持しない";
String w3="わからない・どちらともいえない";
int tr;
for(tr=1;tr<46;tr++){
String date="";
readfile sub52=new readfile();
sub52.makedata("data/"+tr+".txt","UTF-8");
data=sub52.data;
datanumber=sub52.datanumber;
String str="";
int z=0;
for(s=1;s<datanumber;s++){
if(data[s].indexOf("<table")>-1)z=100;
if(z>50)str=str+data[s];
if(data[s].indexOf("電話による対話形式")>-1)date=data[s];
}
String[] x=str.split("</tr>");
System.out.println(date);
for(s=0;s<x.length;s++){
x[s]=x[s].replace("</td>","△");
x[s]=change(x[s]);
String[] y=x[s].split("△");
if(x[s].indexOf("[今回]")>-1) System.out.println(y[0]+","+y[1]);
}
}
}
String change(String str){
int n;
for(n=1;n<11;n++){
str=rev(str);
}
str=str.replace(" ","");
return str;
}
String rev(String str){
if(str==null)str="";
int p1=str.indexOf("<");
int p2=-1;
if(p1>-1)p2=str.indexOf(">",p1);
String strx="";
if(p2>-1)strx=str.substring(p1,p2+1);
str=str.replace(strx,"");
return str;
}
}
最終更新:2016年07月26日 10:35