Before you use this script, please enable Drive API at Advanced Google services.
Now add the script.
function importXLS(){
var folderBId = "###"; // Added // Please set the folder ID of "FolderB".
var files = DriveApp.getFolderById('1hjvNIPgKhp2ZKIC7K2kxvJjfIeEYw4BP').searchFiles('title != "nothing"');
while(files.hasNext()){
var xFile = files.next();
var name = xFile.getName();
// Check if the file has the MimeType .xslx
if (xFile.getMimeType() == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"){
var ID = xFile.getId();
var xBlob = xFile.getBlob();
var newFile = {
title : name+'_converted',
parents: [ folderBId ] // Added
};
file = Drive.Files.create(newFile, xBlob, {
convert: true,
mimeType: "application/vnd.google-apps.spreadsheet"
});
// Drive.Files.remove(ID); // Added // If you want to remove the original XLSX.
}
}
}