%@ page import="java.io.*" %>
<%@ include file ="../include/common.jsp"%>
<%@ page contentType="text/html;charset=big5"%>
Printing...
<%
String thisLine;
int start, intStartCheck, intEndCheck, startTable, endTable, statusTable;
String filePath = gbl_dir + "health_info/disease_information/pain/";
int fileCount = 18;
String[] fileName = new String[fileCount];
fileName[0] = "c_pain_about1.html";
fileName[1] = "c_accute_pain.html";
fileName[2] = "c_chronic_pain.html";
fileName[3] = "c_to_introduction.html";
fileName[4] = "c_to_medications.html";
fileName[5] = "c_to_injection.html";
fileName[6] = "c_to_electrical.html";
fileName[7] = "c_to_physical.html";
fileName[8] = "c_to_relaxation.html";
fileName[9] = "c_to_lifestyle.html";
fileName[10] = "c_to_surgery.html";
fileName[11] = "c_talk_doctor.html";
fileName[12] = "c_extra_arthritis.html";
fileName[13] = "c_extra_dysmenorrhea.html";
fileName[14] = "c_extra_osteoarthritis.html";
fileName[15] = "c_extra_osteoarthritis1.html";
fileName[16] = "c_extra_osteoarthritis2.html";
fileName[17] = "c_extra_osteoarthritis3.html";
for (int i=0; i < fileCount; i++) {
FileInputStream fname = new FileInputStream(filePath + fileName[i]);
InputStreamReader isr = new InputStreamReader(fname, "Big5");
BufferedReader brInputBuffer = new BufferedReader(isr);
start = 0;
intStartCheck = -1;
intEndCheck = -1;
startTable = -1;
endTable = -1;
statusTable = 0;
out.println("");
out.println("");
while ((thisLine = brInputBuffer.readLine()) != null) { // while loop begins here
intStartCheck = thisLine.indexOf("");
startTable = thisLine.indexOf("");
if ((start == 1) && (statusTable == 2)) {
if (intStartCheck != -1) {
out.println(thisLine.substring(intStartCheck, thisLine.length()));
} else if (intEndCheck != -1) {
out.println(thisLine.substring(0, intEndCheck));
} else {
out.println(thisLine);
}
}
if (intStartCheck != -1) {
start = 1;
}
if ((start == 1) && (intEndCheck != -1)) {
start = 0;
}
if ((start == 1) && (startTable != -1) && (statusTable == 0)) {
statusTable = 1;
}
if ((start == 1) && (endTable != -1) && (statusTable == 1)) {
statusTable = 2;
}
} // end while
out.println("");
out.println(" ");
fname.close();
}
%>
|