Want to create dispatch action to renaming the files by just adding the space in the same.
Existing file names are like- CI XXXXXXXXXX
Required to rename like- CI X XX XX XXXX X (Just want to add Space in to existing file name)
This is easily accomplished using string functions and variables.
See attached sample and video.
p.s. the OK Messagebox statements are for debugging/development/teaching purposes only - feel free to remove them.
I need your more assistance in the same dispatch as i have added "part_5" with Extension i.e from Right, 7 Characters. But need your help to change further i.e if i have a name of file such like :
Existing File name- "CI 0123456789 File Name.sldprt"
Required like- "CI 0 12 34 5678 9 File Name.sldprt" Here the characters after "9" To till "." is variable not fixed in qty so can you help me out to create such action.
I'm going to make you do the work so you learn :-)
Here are my tips:
1) Use the string function Length(%NameOfSelectedFile%) to get the length of the filename (includes the extension)
2) Use the string function ReverseFind(%NameOfSelectedFile%, .) to find the position of the dot within the string (the number counts the characters from left to right)
3) Use the arithmetic functions Sub(%var1%, var2%) to figure out how to extract the rest of the string into a variable.
The ReverseFind(%NameOfSelectedFile%, .) function is also versatile when there are file extensions of varying length.
What i have done is i have created new variable with added all the characters after 13 No to till 100 so it also includes extension.
That will works for me & it works fine for me.
JAYMIN J. C
Thanks a lot Joy it works fine as expected, Might it will be more helpful to other people searching out for the same.
I'm glad you have it working the way you want it - great job.
You are correct that only one variable is required for 'the rest of the string'.
Here is my example with a little debugging logic added so I could ensure the rename would be correct before I actually renamed it.
Keep learning :-)
Retrieving data ...