?? iotest_yanggx.java
字號:
package com.jk.io;
import java.io.*;
import java.util.*;
public class IoTest_yanggx {
/**
* @param args
*/
public static void readFile(){
String path = "D:/radwtmp";
File f = new File(path);
try {
RandomAccessFile raf = new RandomAccessFile(f, "rw");
if(f.exists() && f.canRead()){
String data = "";
while((data = raf.readLine()) != null){
StringTokenizer token = new StringTokenizer(data, "|");
String[] datas = new String[token.countTokens()];
int i = 0;
while(token.hasMoreElements()){
datas[i] = token.nextToken();
i++;
}
for(int j = 0; j < datas.length; j++){
System.out.print(datas[j] + " ");
}
System.out.println();
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
readFile();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -