var myFile = new File("/Desktop/abc.csv");
//GetFileName
function GetFileName(Num,FilePath){
var returnStr="";
var reg=/(.*)(?:\.([^.]+$))/;
switch(Num){
case 0 : returnStr = FilePath.name.match(reg)[0]; break; //abc.csv
case 1 : returnStr = FilePath.name.match(reg)[1]; break; //abc
case 2 : returnStr = FilePath.name.match(reg)[2]; break; //csv
}
return returnStr;
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00