#1 2008-12-23 01:42

ivanivienen
Member
Registered: 2008-12-19
Posts: 11

Combine folder name and file name

Hello. My name is Ivan, from Spain I am not used to pascal scripting and I have a doubt. Let us say I have a folder name subjects. In this folder I have maths, sciences, and so on. In these folders I have files named 001.mp3 002.mp3 and so on. I would need to have only one folder named subjects. In this folder thereshold should be only files. Those files should be names maths001.mp3 matsh002.mp3 and so on, and the same for the rest of folders. I would need therefore to move files and delete emptied folders. I am not sure if I am myself quite explanatory. Thanks in advance for all. Ivan.

Offline

#2 2008-12-23 16:06

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Combine folder name and file name

Your problem description is not very clear. Can you explain with an example of the Before and After cases?

For example,

Before
Subjects\Maths\001.mp3
Subjects\Maths\002.mp3
Subjects\Science\001.mp3
Subjects\Science\002.mp3
Subjects\English\001.mp3
Subjects\English\002.mp3

After
Subjects\Maths001.mp3
Subjects\Maths002.mp3
Subjects\Science001.mp3
Subjects\Science002.mp3
Subjects\English001.mp3
Subjects\English002.mp3

Offline

#3 2008-12-23 18:12

ivanivienen
Member
Registered: 2008-12-19
Posts: 11

Re: Combine folder name and file name

Hello Andrew and thanks for your answer. The structure of folders and files that I have and I need is exactly as you just wrote . Would there be any pascal rule or other mean to achieve this? Thanks again for all. Regards, Ivan.

Offline

#4 2008-12-23 22:32

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Combine folder name and file name

Thanks Andrew for clarifying.  I had my problem with this description too, but had no time to ask back.



Hi Ivan, welcome.

To add the parent folder name ADD an rule INSERT, chose InsertMetaTag :File_FolderName:
To move an file you can try old DOS syntax. To move one folder up ADD an rule INSERT and type ..\ ( dot dot back slash)

You can also combine this two rules:
- ADD an rule INSERT
- type ..\
- chose > InsertMetaTag > :File_FolderName:

Then PREVIEW, is all O.K.? then RENAME
Then delete the empty folders.

Note: you should test this with some test files first

Last edited by Stefan (2008-12-23 22:34)


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#5 2008-12-24 00:32

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

Re: Combine folder name and file name

Thanks Stefan for that trick.

But I have a doubt for Denis, on the program after doing that, the "new path"column doesn't show the final result... and after doing the rename also ramain the "..\" on the actual path.

I wanted to know a litle more about it because, for long paths, it might be problematic because renamer gives the warning of max path limit and after that doesn't let you rename.



To explain my point of view, imagine I have this file:
C:\Downloads\ReNamer\renamer.zip

INSERT: ..\..\ReNamer\

Program result:
C:\Downloads\ReNamer\..\..\ReNamer\renamer.zip

Real result:
C:\ReNamer\renamer.zip

You can see some significant diference on the lenght of the path



Is only an example. I'm not complaining about it, just wanted to share this thoughts. wink


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

Offline

Board footer

Powered by FluxBB