Fix for type mismatch error " file to string "
In the below code im list the files from the folders and passing the file
name to the method loadCSV. But I am getting type mismatch error here. plz
help
String Folderfilename= list[i];
can saying "cannot convert file to string"
File foldername = new File(filename);
System.out.println("actual"+foldername);
File[] list = foldername.listFiles();
for(int i=0; i<list.length; i++){
System.out.println("inside for" +list.length);
String substring = list[i].getName().substring(0,
list[i].getName().indexOf("."));
System.out.println("substring" +substring);
if(list[i].isFile() && list[i].getName().contains(".csv")){
////////getting mismatch error in the below line
String Folderfilename= list[i];
new SCLoad().loadCSV(con,Folderfilename, ImportTable);
System.out.println("CLASS NAME "+list[i]);
}
}
No comments:
Post a Comment