📄 readcolumn.java
字号:
package net.aetherial.gis.test;
import java.io.File;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.FileInputStream;
import java.io.*;
import java.io.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class ReadColumn {
private String fileName = "E:\\test\\2\\tools\\formate\\column.txt";
public ReadColumn() {
}
/**
* HEADER[0] = "路段编码";
*/
private String toHeadLine(int pos,String line){
return "HEADER[" +pos +"] = \"" + line.trim() + "\";";
}
/**
* t.addRecord(new Record("columnEInDepart", Record.STRING, 0, 1, "迄点所在行政区划"));
*/
private String toColumn(String line){
return "t.addRecord(new Record(\"column \", Record.STRING, 0, 1, \"" + line + "\"));";
}
private void read(){
try {
BufferedReader in = new BufferedReader(new InputStreamReader(new
FileInputStream(fileName)));
String line = new String("");
int i = 0;
for (line = in.readLine(); line != null; line = in.readLine(), i++) {
// System.out.println(this.toHeadLine(i,line));
System.out.println(this.toColumn(line));
}
}
catch (FileNotFoundException ex) {
}
catch (IOException ex) {
}
}
public static void main(String args[]){
ReadColumn rc = new ReadColumn();
rc.read();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -