#1 2011-02-13 09:25

ljweser
Member
Registered: 2011-02-13
Posts: 4

Move pictures to folders by their name

begin
 filename:=filepath+'\'+filename
end.

this produces something like this c:\Pictures\family pics\nameofpicture.jpg\nameofpicture.jpg
how do u do this with out trying to create a directory with an ext. As far as I know you cannot create a directory with a extension in any operating system so why would doing this do exactly that.
I want to create a directory with the filename excluding the extension and copy serialized files into it. Can you help please
Lorne

Offline

#2 2011-02-13 11:13

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

Re: Move pictures to folders by their name

You can add folders just inserting the name of the folder in front of the filename, the pascal is not needed.

I think you should try with: Insert ":File_BaseName:\" as Prefix


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

Offline

#3 2011-02-13 12:07

ljweser
Member
Registered: 2011-02-13
Posts: 4

Re: Move pictures to folders by their name

Thanks for the quick reply, useing "file_basename" makes a directory for each pic
I have pics named examplea1.jpg, examplea2.jpg, examplea3.jpg, and exampleb1.jpg exampleb2.jpg etc (just examples) if i use file_basename  each file gets a different folder. I want to put the examplea*.jpg's in 'examplea' folder and the exampleb*jpg's in the exampleb folder etc. as I have allot  of family pics and would like to reduce the time it takes to load the base directories. I found a script and after hours of trial and error came up with this.

var
  BaseName, PathName, ExetName: WideString;
    
begin
  BaseName := WideExtractBaseName(FileName);
  ExetName := WideExtractFileExt(FileName);
  PathName := WideExtractFilePath(FilePath);
  Filename := PathName+BaseName+'\'+BaseName+ExetName;
end.

Offline

#4 2011-02-13 12:13

ljweser
Member
Registered: 2011-02-13
Posts: 4

Re: Move pictures to folders by their name

No need to apologize for your english and thanks again for the help

Offline

#5 2011-02-13 16:27

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Move pictures to folders by their name

Hi!

For the purpose stated, you can simply use the $0\$0 token in normal rules. No pascal needed at all.
See help here: http://www.den4b.com/wiki/ReNamer:Renam … her_folder

Offline

Board footer

Powered by FluxBB