#1 2009-02-25 18:09

phreaq
Member
Registered: 2009-02-25
Posts: 6

Renaming Children Folders with Parent Name

Hi Folks,

I am trying to rename a series of folders, but I'm not sure how to do it, since metadata isn't available for folders.

My current structure is:

c:\artist\album\[contents]

I want to combine the names so that I get a folder name of "artist - album".

I suspect my final folder structure would look like this (c:\artist\artist - album\[contents]), which is fine, I'll just drag the children to the root.

any help is appreciated,

thanks in advance,

Offline

#2 2009-02-25 19:16

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Renaming Children Folders with Parent Name

Take a look on that topic. It might be useful.


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

#3 2009-02-25 20:02

phreaq
Member
Registered: 2009-02-25
Posts: 6

Re: Renaming Children Folders with Parent Name

thanks for the reply krtek

I did see that post, but it's using information from the first file to populate the folder prefix. My files don't have the parent folder information stored in them, so I cannot pull any data from the file itself.

or am I missing something?

Offline

#4 2009-02-28 13:10

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

Re: Renaming Children Folders with Parent Name

You can use :File_FolderName: meta tag to access parent folder name.

So in your case, when you added your folders as files for renaming, add Insert rule: ":File_FolderName: - ".

Offline

#5 2009-03-03 14:21

phreaq
Member
Registered: 2009-02-25
Posts: 6

Re: Renaming Children Folders with Parent Name

I tried using the  option, but I'm not getting the results I want. I just get " - album name", no artist info

Where is it trying to get the meta data from? I don't have any files in the folders that have meta data info.

Offline

#6 2009-03-03 14:55

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Renaming Children Folders with Parent Name

Hmmm... I have reproduced that result.
It seems that :File_FolderName: works only for files and not for folders...

Last edited by krtek (2009-03-03 16:08)


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

#7 2009-03-03 14:58

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Renaming Children Folders with Parent Name

The metatags don't work for folders roll roll roll

Last edited by SafetyCar (2009-03-03 14:59)


If this software has helped you, consider getting your pro version. :)

Offline

#8 2009-03-03 15:04

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Renaming Children Folders with Parent Name

You can try to use this simple PascalScript for that job:

var 
Path, SubFolders : TStringsArray;
Depth : Integer;
 
begin
  if not WideFileExists(FilePath) then
  begin
    SetLength(SubFolders,0);
    Path:=WideSplitString(FilePath,'\');
    WideScanDirForFolders(FilePath, SubFolders ,True, False, False);
    Depth:=Length(Path);
    If (Depth>1) and (Length(SubFolders)=0) then
      FileName:=Path[Depth-2]+' - ' + Path[Depth-1];
  end;
end.

Script will omit files and will proceed only the deepest folders.

Last edited by krtek (2009-03-03 15:25)


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

#9 2009-03-03 15:49

phreaq
Member
Registered: 2009-02-25
Posts: 6

Re: Renaming Children Folders with Parent Name

krtek wrote:

You can try to use this simple PascalScript for that job:

var 
Path, SubFolders : TStringsArray;
Depth : Integer;
 
begin
  if not WideFileExists(FilePath) then
  begin
    SetLength(SubFolders,0);
    Path:=WideSplitString(FilePath,'\');
    WideScanDirForFolders(FilePath, SubFolders ,True, False, False);
    Depth:=Length(Path);
    If (Depth>1) and (Length(SubFolders)=0) then
      FileName:=Path[Depth-2]+' - ' + Path[Depth-1];
  end;
end.

Script will omit files and will proceed only the deepest folders.

dude, you rock. that does the trick

it's been a while since I used pascal, thanks for your efforts.

Offline

#10 2009-09-16 22:55

alext
Member
Registered: 2009-09-16
Posts: 2

Re: Renaming Children Folders with Parent Name

Hi,
I'm really struggling with something which seems very related to this but since I don't understand pascal I don't know how to modify this script for my needs.
Basically, I have songs files in a big folder in the format "Artist - Song.mp3". I want to rename them so that all the songs by the same artist appear in separate folders. ie I want to have "Artist/Song.mp3".
Please can you help. I know this must be simple but I've been searching the forum for ages and still have no idea.
Thanks!

Offline

Board footer

Powered by FluxBB