- AuthorPosts
- September 6, 2008 at 9:36 pm #6181jadde29Participant
Hello,
I have tried to create a macro which cut the file name in the whole path stringMaybe example makes things clear
I have a string which is the whole path to the file like:C:folder_1folder_2myfile.ext
I need a macro which can cut the last part of the string leaving only the path like that:
C:folder_1folder_2
Of course, the length of the name of the file is unknown.
I’ve tried to find a solution but still no clue how it can be done.
Please help gurus, I need it badlyThanx for your time
September 7, 2008 at 3:35 am #6184yorkaneMembervar fullFileName = ‘C:folder_1folder_2myfile.ext’;
var i = fullFileName.lastIndexOf(”) +1;
var path = fullFileName.substring(0,i);
alert(path);September 7, 2008 at 1:53 pm #6185jadde29ParticipantGreat thanx yorkane
Just two questions:
Can the result be saved or copied to the clipboard instead of pop-up window?
Can it be more universal-I mean when the path is different or when the text file contains many path strings?Once again, great thanx for the responce
- AuthorPosts
- You must be logged in to reply to this topic.