java初探/java读取文件

import java.io.*;
import java.util.Arrays;

public class WriteText {
public static void main(String[] args) throws Exception {
FileReader fr=new FileReader("./part-00001");
BufferedReader br=new BufferedReader(fr);
String[] info = null; 
String line = null; 
while((line=br.readLine())!=null) {
  info = line.split("\t");
  if (info.length <60) {
     continue;
  } 
  if (info.length <83) {
    String s = info[1] + "\t" + info[57];
    System.out.println(s);
  } 
} 
}
}

javac WriteText.java编译

java WriteText 运行即可

 

posted on 2015-05-26 11:38  出发的兰彻  阅读(240)  评论(0编辑  收藏  举报

导航