import java.io.*;
class ren{
String data,str;
int[] x=new int[5000];
int[] y=new int[5000];
String[] credit=new String[5000];
String[] content=new String[5000];
int s,sx,xmlnumber,authornumber;
int h,p1,p2;
public static void main(String [] args) {
ren test=new ren();
}
ren(){
readfile("data/5000.txt");
xymaker(data);
for(s=1;s<xmlnumber;s++){
credit[s]=makecredit(s,data);
content[s]=makecontent(s,data);
}
for(s=1;s<100;s++){
if(content[s].length()>0)System.out.println(content[s]);
}
}
String makecontent(int s,String data){
int p1,p2;
String str;
p1=y[s];
p2=x[s+1];
str="";
if(p2>p1)str=data.substring(p1+1,p2);
return str;
}
String makecredit(int s,String data){
int p1,p2;
String str;
p1=x[s];
p2=y[s];
str="";
if(p2>p1)str=data.substring(p1+1,p2);
return str;
}
void xymaker(String data){
int p1,s;
s=1;
p1=data.indexOf("<");
x[s]=p1;
while(p1>0){
p1=data.indexOf("<",p1+1);
if(p1>0)s=s+1;
if(p1>0)x[s]=p1;
}
xmlnumber=s;
for(s=1;s<xmlnumber+1;s++){
y[s]=data.indexOf(">",x[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日 16:05