RTTSoftware Support Forum

PDF Explorer => Ideas/Suggestions => Topic started by: RW on July 21, 2015, 06:32:24 PM

Title: Current Folder Column
Post by: RW on July 21, 2015, 06:32:24 PM
Could a column be created that just shows the "current folder" name of the current file, not all the other folders that this current folder is nested under. 
And this column would need to be exportable to a csv file also.

I don’t want the column that has all this      c:\pictures\2015\summer\
I just want the column to show only the last folder called       summer\    or    summer
Title: Re: Current Folder Column
Post by: RTT on July 22, 2015, 12:57:30 AM
As with the column part of this example (http://www.rttsoftware.com/forum.php?dsturl=http%3A%2F%2Fwww.rttsoftware.com%2Fforum%2Findex.php%3Ftopic%3D504.msg1382%3Btopicseen%23new), set a custom field, with a custom grid layout to show it, and use the Edit Info Fields batch tool with this GetParentFolderName named script.
Code: [Select]
function GetParentFolderName() {
    var path = BatchFile.Filename.substring(0,BatchFile.Filename.lastIndexOf('\\'));   
    //remove parent folders
    path = path.substring(path.lastIndexOf('\\')+1);
    return path;
}
Title: Re: Current Folder Column
Post by: RTT on July 22, 2015, 01:21:47 AM
Or just use a custom grid layout dynamically calculated column (http://www.rttsoftware.com/Manuals/Index.htm?pageURL=PDFE/English/LayoutEditor.htm#calculated_columns), with this code as the eval expression:
Code: [Select]
begin
var 'i','path' end;
$path:=leftstr(FP,length(FP)-1);
$i:=pos('\',reversestr($path));
return(rightstr($path,$i-1));
end