#1 2008-04-27 19:54

V@no
Member
Registered: 2008-04-27
Posts: 4

How to add folders name including subfolders?

Hello!
Have folder:
C:\test\test1\test2\test3\file.ext

Using :File_FolderName: tag only inserts folder's name where the file is (test3), is there a way add parent folder names (test, test1, test2) ?

Thank you.

Offline

#2 2008-04-27 20:03

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,378

Re: How to add folders name including subfolders?

You can use PascalScript rule, it will allow you to use the file path in any imaginable way.

For example, the code below will prefix each file with all its subfolders separated with a dash:

var
  Temp: WideString;
begin
  Temp := WideExtractFilePath(FilePath);
  Temp := WideCopy(Temp, 4, Length(Temp));
  Temp := WideReplaceStr(Temp, '\', ' - ');
  FileName := Temp + FileName ;
end.

Offline

#3 2008-04-27 20:13

V@no
Member
Registered: 2008-04-27
Posts: 4

Re: How to add folders name including subfolders?

Wow! 9 minutes and ready to use and working solution!
Thank you very much!

P.S.
may I ask you why Pascal?

Offline

#4 2008-04-27 20:15

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,378

Re: How to add folders name including subfolders?

I was just around, reading through posts, usually it would take longer wink

may I ask you why Pascal?

What do you mean? Why not other rule, or why not other language?

Offline

#5 2008-04-27 20:17

V@no
Member
Registered: 2008-04-27
Posts: 4

Re: How to add folders name including subfolders?

Yes, why Pascal language?
Isn't it pretty much "dead" language by now?

Offline

#6 2008-04-27 20:19

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,378

Re: How to add folders name including subfolders?

Oh, well, the answer is simple: ReNamer is written in Pascal (Delphi) big_smile

And I can assure you that it is not dead! It is coming back to live now: CodeGear, FreePascal, etc...

Offline

#7 2008-04-27 20:31

V@no
Member
Registered: 2008-04-27
Posts: 4

Re: How to add folders name including subfolders?

Oh!:D

Thanks again for this great program(s) and support!

Offline

Board footer

Powered by FluxBB