File file = new File("C:/huhuhu.txt");
        FileInputStream in = new FileInputStream(file);
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String line = null;
        line = br.readLine();
        int i=1;
        String header = "rcvNotify -i ";
       
        File file2 = new File("C:/output.txt");
        FileWriter out = new FileWriter(file2);
       
       
       
        while ((line) != null && !line.equals("-----")) {
            header += line + ",";
           
            if(i%100==0){
                header = header.substring(0, header.length()-1);
                out.write(header);
                header = "\r\nrcvNotify -i ";
            }
           
            System.out.println(i);
            i++;
            line = br.readLine();
        }
       
       
       
        in.close();
        out.close();

 

===============================

String path = "C:/home/logs";
String name = "a.txt";
File file = new File(path, name);
System.out.println(file.getParentFile().getName());
file.getParentFile().mkdir();
file.createNewFile();

相关文章:

  • 2021-09-29
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
  • 2022-02-01
  • 2021-10-20
  • 2021-08-31
相关资源
相似解决方案