急,在线等。。!!新手遇到问题请赐教
以下是一个HTML的分析程序,目的是将HTML格式的表格转化成一个表格,去除HTML的标记(如HTML,TABLE,TR,TD等)。
遇到一个问题,当出现表格中日期时怎么来显示
import java.io.*;
import java.util.*;
public class test{
public static void main(String[] args) throws IOException
{
//
// Create a file, a reader, and attach it to a tokenizer.
//
File inputFile = new File(\"che.html\"
;
FileReader in = new FileReader(inputFile);
StreamTokenizer parser = new StreamTokenizer(in);
boolean flag=true;
double token;
//
// While the next token is not the end of the file read it in
// and determine if it is a string or a number.
//
while ((token = parser.nextToken()) != StreamTokenizer.TT_EOF)
{
//
// Words are stored in the .sval variable
//
if(token ==\'\') flag= true;
if (token == StreamTokenizer.TT_WORD)
if(parser.sval.equalsIgnoreCase(\"tr\"
) System.out.println();
if (token == StreamTokenizer.TT_WORD && flag) {
String x = parser.sval;
System.out.print(x + \"\\t\"
;
}
//
// Numbers are stored in the .nval variable
//
else if (token == StreamTokenizer.TT_NUMBER && flag) {
double num=parser.nval;
System.out.print(num + \"\\t\"