You are not logged in.
Pages: 1
Purchased a Pro License.
Is there a way to only use the first word of a folder instead of the entire folder name (if it's more than 1 word)
? If not, could there be in the future?
Example:
I have a folder named "Pictures - Volume 001"
If I use :File_FolderName: then the output will be
"Pictures - Volume 001" but I want it to only fetch the first word of the folder, so it becomes "Pictures" instead.
a space would indicate that the word ended.
and no, I can't simply insert "Pictures" as the folder name may vary and I want to avoid having to modify the text based on the folder name
Last edited by eswiig (2015-01-26 21:33)
Offline
You can remove not needed parts after you insert the full folder name.
For example:
1) Insert: Insert "[:File_FolderName:] " as Prefix
2) Rearrange: Split by exact pattern of delimiters "[", " ", "]", New pattern "$1$2$4"
Input: C:\Temp\Pictures - Volume 001\File.txt
Output: C:\Temp\Pictures - Volume 001\Pictures File.txt
What this does is inserts the folder name in square brackets, and then extracts only the first word out of the square brackets. Note that if there won't be a space in the folder name then the square brackets will be left as is, so you may need to also strip them with another rule.
Last edited by den4b (2015-01-26 22:25)
Offline
Thank you for the reply!
It is awesome that there is such a function but...
Hmmm what am I doing wrong?
this is the path: C:\Temp\Pictures - Volume 001\File.txt
Last edited by eswiig (2015-01-26 22:52)
Offline
There might be a non-standard space character involved (one of unicode variants).
Can you try using RegEx rule instead:
1) Insert: Insert "[:File_FolderName:] " as Prefix
2) RegEx: Replace expression "\[(.*?)\s(.*?)\]" with "$1"
If it still doesn't work, please use "Export all columns to clipboard" option from the "Export" menu and paste the content here as code (use the button in the toolbar when writing a post).
Offline
almost there,
the RexEx gave me "PicturesFile.txt"
can you please adjust it to give me just "Pictures"?
Offline
Simply insert the extra space in your first rule.
Note the space character at the end of "[:File_FolderName:] ".
Offline
Sorry to be a bother, I am totally green when it comes to RegEx...
I must say support is excellent... and I will continue to support by keeping/renewing the Pro License.
that gave me "Pictures File.txt"
I simply want only "Pictures.txt"
Last edited by eswiig (2015-01-26 23:05)
Offline
File.txt Pictures File.txt OK
Offline
No problem, just add a Delete rule as your first rule:
1) Delete: Delete from Position 1 until the End
2) Insert: Insert "[:File_FolderName:]" as Prefix
3) RegEx: Replace expression "\[(.*?)\s(.*?)\]" with "$1"
Offline
that did it, excellent..
thanks, consider this issue solved...
Last edited by eswiig (2015-01-26 23:08)
Offline
Pages: 1