アットウィキロゴ

あうth

import java.io.*;

class author{

String data,data1,data2;
int s,sx,p1,p2,ss,pnumber;
String str,str1,str2;
String[] z=new String[500];
String[] author=new String[500];
int t,authornumber;
int along;

public static void main(String [] args) {
        author test=new author();
            }

author(){

readfile("data/4000.txt");

p1=data.indexOf("○");

data1=data.substring(0,p1);

System.out.println(data1);

String[] x=data1.split("<BR>");

sx=0;
for(s=0;s<x.length;s++){
if(x[s].indexOf("君")>1)sx=sx+1;
if(x[s].indexOf("君")>1)z[sx]=x[s];
}

for(s=1;s<sx+1;s++){
z[s]=z[s].replace(" ","△");
z[s]=z[s].replace(" ","△");
z[s]=z[s].replace("委員長","△");
z[s]=z[s].replace("理事","△");
}


for(s=1;s<sx+1;s++){
p1=z[s].indexOf(")");
if(p1>0)z[s]=z[s].substring(p1+1,z[s].length());
}

t=0;

for(s=1;s<sx+1;s++){
p1=z[s].indexOf("君△");
if(p1<0)z[s]=z[s].replace("△","");
if(p1<0)t=t+1;
if(p1<0)author[t]=z[s];
}

for(s=1;s<sx+1;s++){
p1=z[s].indexOf("君△");
String[] z2=z[s].split("君△");
if(p1>0)t=t+1;
if(p1>0)author[t]=z2[0];
if(p1>0)t=t+1;
if(p1>0)author[t]=z2[1];
}

authornumber=t;


for(s=1;s<authornumber+1;s++){
author[s]=author[s].replace("△","");
along=author[s].length();
str=author[s].substring(along-1,along);
if(str.equals("君"))author[s]=author[s].substring(0,along-1);
}


for(s=1;s<authornumber+1;s++){
System.out.println(author[s]);
}



}


void readfile(String file){

String str;
BufferedReader br;  

try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"SJIS"));  
while((str = br.readLine()) != null) {  
data=data+str;  
}
br.close();
} catch (IOException e) {System.out.println(e);}  

}


}
最終更新:2011年06月26日 23:47