日期:2014-05-20 浏览次数:20910 次
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
public class ReadTxt {
static ArrayList<String> logData = new ArrayList<String>();
static String text = null;
public static void read(String filePath) {
try {
FileReader input = new FileReader(filePath);
BufferedReader br = new BufferedReader(input);
while (( text = br.readLine()) != null) {
logData.add(text);
}
br.close();
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public class Test32 {
static String[] str1 = null;
static String[] str8 = null;
static String str10 = null;
static String Path = "D:\\MyDoc\\Dport\\MakeaTry.txt";
static int len = -1;
public Test32(){
String str = "E:\\8.txt";
ReadTxt.read(str);
len = ReadTxt.logData.size();
str8 = new String[len];
for(int i=0;i<len;i++){
str8[i]=ReadTxt.logData.get(i);