package pon4;
import java.io.File;
import tool.readfile;
import java.io.*;
public class pro {
int datanumber;
String[] data=new String[500];
String[] subdata=new String[5000];
int tr;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
File d=new File("data");
String[] dx=d.list();
for(tr=0;tr<dx.length;tr++){
readfile sub=new readfile();
sub.makedata("data/"+dx[tr],"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
int s=0;
String str="";
for(s=1;s<datanumber+1;s++){
data[s]=data[s].replace("。","。△");
str=str+data[s];
}
String[] x=str.split("△");
for(s=0;s<x.length;s++){
subdata[s+1]=x[s];
}
datanumber=x.length;
writehtml("gdata/"+tr+".html");
}
}
void writehtml(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
pw.println("<html>");
pw.println("<head>");
pw.println("<meta charset=\"UTF-8\">");
pw.println("</head>");
pw.println("<body>");
for(s=1;s<datanumber+1;s++){
pw.print("<h1>");
pw.print(subdata[s]);
pw.println("</h1>");
}
pw.println("<a href=\""+(tr-1)+".html\">前</a>");
pw.println("<a href=\""+(tr+1)+".html\">次</a>");
pw.println("</body>");
pw.println("</html>");
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
}
最終更新:2016年06月01日 05:15