- package edu.thu.keyword.test;
-
- import java.io.File;
- import java.io.InputStreamReader;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.FileInputStream;
- import java.io.FileWriter;
-
- public class cin_txt {
- static void main(String args[]) {
- try {
-
-
- String pathname = "D:\\twitter\\13_9_6\\dataset\\en\\input.txt";
- File filename = new File(pathname);
- InputStreamReader reader = new InputStreamReader(
- new FileInputStream(filename));
- BufferedReader br = new BufferedReader(reader);
- String line = "";
- line = br.readLine();
- while (line != null) {
- line = br.readLine();
- }
-
-
- File writename = new File(".\\result\\en\\output.txt");
- writename.createNewFile();
- BufferedWriter out = new BufferedWriter(new FileWriter(writename));
- out.write("我会写入文件啦\r\n");
- out.flush();
- out.close();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
posted @
2017-10-20 13:44
冰山一杰
阅读(
46099)
评论()
编辑
收藏
举报