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();