public static void main(String[] arg) throws Exception {
    BufferedReader reader = new BufferedReader(new FileReader(
        "C:\\Documents and Settings\\Administrator\\桌面\\test.txt"));
    boolean hasInvalidData = false;
    while (reader.ready()) {
      String line = reader.readLine();
      System.out.println(line);
      if (line != null) {
        String[] temp = line.split("\t");
        if (temp.length != 2) {
          System.out.println("?");
          hasInvalidData = true;
          break;
        }
      }
    }
    if (hasInvalidData)
      System.out.println("invalid file!");
    else
      System.out.println("valid file.");
  }