展开全部
public static void main(String[] args)throws Exception
{
String path="d:\\aa.txt";
File file=new File(path);
FileInputStream fis=new FileInputStream(file);
InputStreamReader isr=new InputStreamReader(fis,"utf-8");
BufferedReader br=new BufferedReader(isr);
StringBuffer line=new StringBuffer();
String str=null;
File file1=new File("d:\\cc.txt");
FileOutputStream fos=new FileOutputStream(file1);
OutputStreamWriter osw=new OutputStreamWriter(fos,"utf-8");
BufferedWriter bw=new BufferedWriter(osw);
while((str=br.readLine())!=null){
line.append(str);
line.append("\n");
}
System.out.println(line);
bw.flush();
bw.close();
}
至于导入数据库,不难吧,创建个连接就可以把从流读出的数据写进去了
{
String path="d:\\aa.txt";
File file=new File(path);
FileInputStream fis=new FileInputStream(file);
InputStreamReader isr=new InputStreamReader(fis,"utf-8");
BufferedReader br=new BufferedReader(isr);
StringBuffer line=new StringBuffer();
String str=null;
File file1=new File("d:\\cc.txt");
FileOutputStream fos=new FileOutputStream(file1);
OutputStreamWriter osw=new OutputStreamWriter(fos,"utf-8");
BufferedWriter bw=new BufferedWriter(osw);
while((str=br.readLine())!=null){
line.append(str);
line.append("\n");
}
System.out.println(line);
bw.flush();
bw.close();
}
至于导入数据库,不难吧,创建个连接就可以把从流读出的数据写进去了
2012-06-20
展开全部
找下出入数据库的代码就行了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询