How can i add in file renamer the name of the parent folder?
e.g.
C:\Work2006\DoTo.txt
C:\Work2006\Work2006-DoTo.txt
$(RelativePath)-$(Name)
$(Drive) , $(Path) , $(RelativePath) didn't seams to work here.
Tip:
with "Options\Rename ...Path"
we can rename AND move. (i never have seen this bevor)
"D:\Old\$(Name)" ...moves NAME to D:\Old\
Request:
how can i COPY instead of move?
Bug ?:
"Options\Rename Full Path"
i get an error message : ~ "Can not case modify folder name" (or like that)
"Change Case:" is at [Don't change]
Renamer Plugin: add parent name
-
- ALTAP Staff
- Posts: 1112
- Joined: 08 Dec 2005, 09:13
- Location: Novy Bor, Czech Republic
- Contact:
Re: Renamer Plugin: add parent name
-select subdirectories which content you want to rename in panelAbteriX wrote:How can i add in file renamer the name of the parent folder?
e.g.
C:\Work2006\DoTo.txt
C:\Work2006\Work2006-DoTo.txt
$(RelativePath)-$(Name)
$(Drive) , $(Path) , $(RelativePath) didn't seams to work here.
-start Renamer (Shift+Ctrl+R)
-select Include subdirectories
-select Options/Rename Relative Paths (or Rename Full Path)
-select Regular Expression
-type in Search for: ([^\\]+)\\([^\\]+)$
-type in Replace with: $1\$1-$2
Please separate this to another topic.AbteriX wrote:Tip:
with "Options\Rename ...Path"
we can rename AND move. (i never have seen this bevor)
"D:\Old\$(Name)" ...moves NAME to D:\Old\
Request:
how can i COPY instead of move?
Please separate this to another topic under Bug Reports. And add more details.AbteriX wrote:Bug ?:
"Options\Rename Full Path"
i get an error message : ~ "Can not case modify folder name" (or like that)
"Change Case:" is at [Don't change]
-
- Plugin Developer
- Posts: 36
- Joined: 11 Dec 2005, 20:08
- Contact:
Re: Renamer Plugin: add parent name
to explain this regular expression:-type in Search for: ([^\\]+)\\([^\\]+)$
[^\\]+ stands for path component, you can add it from the regular expression menu (to the right of the `Search for' field)
\\ stands for backslash
$ stands for end of filename
terms in brackets are captured in the internal variable which can be referenced from `Replace with' form usin dollar expression -- $1 for first captured portion and $2 for the seccond
this quite often requested feature, we have it on our todoRequest:
how can i COPY instead of move?
Please separate this to another topic.
-
- ALTAP Staff
- Posts: 1112
- Joined: 08 Dec 2005, 09:13
- Location: Novy Bor, Czech Republic
- Contact:
Thank you very much for the answers and the regex's.
Today
$(Drive) , $(Path) , $(RelativePath) seams to work here.
Or i have choosen an other option from options menu then yesterday<?>
I have done this with Options|Rename Full Path
and get an error msg on Rename of course. That's OK.
If we could use this
$(Drive) , $(Path) , $(RelativePath) tokens
with Options|Rename Filenames too
we can add this parent folder names with out regex.
But we need then an renamer option "exchange unallowed chars"
like i have done with regex in the test above (\=-, :=-)
I will request this in an another thread.
BTW
the meaning/caption
of "Path" and "Relative Path" is
vice versa exchanged.
i.e.
For $(Path) i get \tmp\xy.exe
For $(RelativePath) i get D:\tmp\xy.exe
Today
$(Drive) , $(Path) , $(RelativePath) seams to work here.
Or i have choosen an other option from options menu then yesterday<?>
I have done this with Options|Rename Full Path
and get an error msg on Rename of course. That's OK.
If we could use this
$(Drive) , $(Path) , $(RelativePath) tokens
with Options|Rename Filenames too
we can add this parent folder names with out regex.
But we need then an renamer option "exchange unallowed chars"
like i have done with regex in the test above (\=-, :=-)
I will request this in an another thread.
BTW
the meaning/caption
of "Path" and "Relative Path" is
vice versa exchanged.
i.e.
For $(Path) i get \tmp\xy.exe
For $(RelativePath) i get D:\tmp\xy.exe
AbteriX