当前位置: 技术问答>java相关
JAVA是怎么一行一行地读文本文件,并把每一行区分开来的?谢谢!
来源: 互联网 发布时间:2015-10-06
本文导语: JAVA是怎么一行一行地读文本文件,并把每一行区分开来的?谢谢! | BufferedReader in= new BufferedReader(new FileReader("d:\co\work3.sql")); String input=new String(); String tablename=new String(""); ...
JAVA是怎么一行一行地读文本文件,并把每一行区分开来的?谢谢!
|
BufferedReader in= new BufferedReader(new FileReader("d:\co\work3.sql"));
String input=new String();
String tablename=new String("");
StringBuffer transresult=new StringBuffer();
int lbracketpos,rbracketpos;
boolean newtable;
input=in.readLine();
String input=new String();
String tablename=new String("");
StringBuffer transresult=new StringBuffer();
int lbracketpos,rbracketpos;
boolean newtable;
input=in.readLine();
|
用java.io.RandomAccessFile的readLine()方法