I'd like to rename a worksheet according to the name of the file i imported in it. I have the filename with its full path obtained from the opendialog in %A variable:
FDLog.get[%A,1];
Is there a way to parse the filename without its path & file extension? (for instance i have "c:\test\MyFile.abf" in %A and i want to parse the substring "MyFile" from it)
Thanks Mike, your code had a couple of imprecisions but the basic principle works like a charm ;) I've attached the corrected code if someone else need it:
FDLog.get(%A,1); for(i=%[%A];i>1;i--) {if("%[%A,i:i]"=="\") break}; // Find last slash position %A=%[%A,>i+1]; // Parse file name %A=%[%A,'.']; // Strip extension win -r %H %A; // Rename worksheet