我试图从用户输入中选择一个文件夹并检查它是否存在,这是我所得到的:
@ECHO OFF
cd backup
set /p name=Please enter the folder name:
pause
for /d in ("\%name%\database.txt") do (
echo done
set flag=1
)
if %flag%==0 echo This folder doesnt exist Returning to maintenance menu...
pause
答案 0 :(得分:-1)
@ECHO OFF
set /p name=C:\:
IF EXIST %name% echo "Folder already exists"
IF NOT EXIST %name% echo "Folder does not exist"
pause
或者你可以简单
function getSheetSectionData(name){
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(name);
var sheetData = sheet.getDataRange().getValues();
var data = [];
for (var i = 0; i < sheetData.length; i++){
var obj = {};
obj = sheetData[i][0];
return sheetData[i][0];
}
data.push(obj);
}