Create a subfolder under a folder

Closed
rose - Sep 7, 2009 at 11:59 PM
 rose - Sep 8, 2009 at 10:41 PM
Hello,
I need to add my reports to excel. SO first I need a create a folder in d drive and then save my reports. I can save directly in d drive. But I cant create a folder through java program.How to get a name for folder from user and create folder in that name.

1 response

The_Mastermind Posts 5 Registration date Monday September 7, 2009 Status Member Last seen September 8, 2009 3
Sep 8, 2009 at 01:13 AM
is there a C drive
4
yes. I try another coding. It works but when the datas are saved in excel file with commas. Its not in proper alignment. I want each data to be placed in each field. How can I do it. My code is

File f=new File("C:/Reports/WorkReports");
if(f.exists()==false)
{
f.mkdirs();
}
String a=search.trim();
File f1=new File("C:/Reports/WorkReports/"+a+".xls");
loc="C:/Reports/WorkReports/"+a+".xls";
if(f1.exists()==false)
{
f1.createNewFile();
}
PrintWriter fw = new PrintWriter(f1);
fw.print("Assigned Date");
fw.print(',');
fw.print("Company/Site");
0