Rename Folders content to Parent Folder Name_Sequential

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Rename Folders content to Parent Folder Name_Sequential

Postby Joshv11889 » Thu Mar 30, 2017 11:06 pm

Hello,

I'm new to the Java world and have a very simple request.

I would like to rename the content of a folder to be the name of the parent folder_filename_sequential# so no name is repeated.

For example,

Folder1>picture1.jpg >>>> Folder1>folder1_picture1_1.jpg
Folder1>picture2.jpg >>>> Folder1>folder1_picture1_2.jpg
Folder2>Pics.jpg >>>> Folder2>folder1_pics_1.jpg

Thanks in advance!!!
Joshv11889
 
Posts: 1
Joined: Thu Mar 30, 2017 11:03 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby Admin » Fri Mar 31, 2017 11:50 pm

Hi, you do not strictly need a Javascript function for this, you can do this type of renaming with Append Folder Name (10) and Numbering (10).
Admin
Site Admin
 
Posts: 1484
Joined: Tue Mar 08, 2005 8:39 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby viral316 » Wed May 03, 2017 5:39 pm

Admin wrote:Hi, you do not strictly need a Javascript function for this, you can do this type of renaming with Append Folder Name (10) and Numbering (10).


What is i want to rename files name in particular "FOLDER NAME_PAGE 1.pdf"


i have files like

FOLDER 1>File 1.pdf
FOLDER 1>File 3.pdf
FOLDER 1>File 4.pdf
FOLDER 1>File 10.pdf
...
FOLDER 2>File 5.pdf
FOLDER 2>File 6.pdf
. ..

I want to rename them as "FOLDER NAME_PAGE 1.pdf"
like
FOLDER 1>File 1.pdf to FOLDER 1_PAGE 1.pdf
FOLDER 1>File 3.pdf to FOLDER 1_PAGE 2.pdf
FOLDER 1>File 4.pdf to FOLDER 1_PAGE 3.pdf
FOLDER 1>File 10.pdf to FOLDER 1_PAGE 4.pdf
...
FOLDER 2>File 5.pdf to FOLDER 2_PAGE 1.pdf
FOLDER 2>File 6.pdf to FOLDER 2_PAGE 2.pdf
. ..

i have idea it can be done using Name (2) and Numbering(10) but in this i have change folder name manualy every time and i have like 150 to 200 folders like that i have to rename files in that according to folder name_page 1.pdf
is there any other way like select folder from left panel and select all files from right panel and rename or run any Javascript function
is it possible with BRU or with Javascript function. I do not have much knowledge of Javascript function.
viral316
 
Posts: 4
Joined: Wed May 03, 2017 5:31 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby Admin » Thu May 04, 2017 1:52 am

Hi, look at the Append Folder Name (9) control in BRU.
Admin
Site Admin
 
Posts: 1484
Joined: Tue Mar 08, 2005 8:39 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby viral316 » Thu May 04, 2017 5:10 pm

Admin wrote:Hi, look at the Append Folder Name (9) control in BRU.


Yes i have check that Append Folder Name (9) option but it just prefix or sufix it
i need like option Name (2) the fixed name that fix the Folder name and then we add numbering. in Name (2) every time we have to change name but is it possible to add fixed folder name in Append Folder Name (9)

E.g i have one folder name "Main Folder" in that folder name there are files with random name like File 1, file 2, S1, s2, f1, f2 etc

what i mean to say is that i want to rename them as Main Folder_Page 1,Main Folder_Page 2,Main Folder_Page 3,Main Folder_Page 4,Main Folder_Page 1, etc.
File 1, file 2, S1, s2, f1, f2 these file name should be replace by above new file names.

the old file name should be replace (what ever the file name are) by Folder name and that sequence numbering

its file adding Fixed option like in Name (2) to Append Folder Name (9).
Is this possible.
viral316
 
Posts: 4
Joined: Wed May 03, 2017 5:31 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby Admin » Fri May 05, 2017 12:15 am

Hi, to clarify given your examples:

FOLDER 1>File 1.pdf to FOLDER 1_PAGE 1.pdf
FOLDER 1>File 3.pdf to FOLDER 1_PAGE 2.pdf
FOLDER 1>File 4.pdf to FOLDER 1_PAGE 3.pdf
FOLDER 1>File 10.pdf to FOLDER 1_PAGE 4.pdf

The process needed is:
- Remove file name
- Prefix folder name
- Add _PAGE
- Add sequential number

Is that correct?
thanks
Admin
Site Admin
 
Posts: 1484
Joined: Tue Mar 08, 2005 8:39 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby viral316 » Fri May 05, 2017 5:05 am

Admin wrote:Hi, to clarify given your examples:

FOLDER 1>File 1.pdf to FOLDER 1_PAGE 1.pdf
FOLDER 1>File 3.pdf to FOLDER 1_PAGE 2.pdf
FOLDER 1>File 4.pdf to FOLDER 1_PAGE 3.pdf
FOLDER 1>File 10.pdf to FOLDER 1_PAGE 4.pdf

The process needed is:
- Remove file name
- Prefix folder name
- Add _PAGE
- Add sequential number

Is that correct?
thanks


Yes, That's correct. But i am unable to find an option to Remove file name.

Btw i found out one solution for this

- set Last n to 10 in Remove (5)
- Prefix folder name in Append Folder Name (9)
- Add spe. _PAGE in Append Folder Name (9)
- Add sufix sequential number in Numbering (10)

But it's good to add an option in Append Folder Name (9) to fixed folder name like in Name (2). so "set Last n to 10 in Remove (5)" this part from above process decrease.
If you can this option in Append Folder Name (9) it's helpful though.

Thanks
Regards
viral316
 
Posts: 4
Joined: Wed May 03, 2017 5:31 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby Admin » Fri May 05, 2017 12:51 pm

Remove Name = Name (2) with Name : Remove
Admin
Site Admin
 
Posts: 1484
Joined: Tue Mar 08, 2005 8:39 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby viral316 » Fri May 05, 2017 2:43 pm

Admin wrote:Remove Name = Name (2) with Name : Remove


great it works.

Thanks...

Btw is it possible to change the files name in particular folders automatically according to folder name_Page 1.pdf... and so on..

i mean we only have to change folder name and files with in that folder will auto manically changes as mention above.

is it possible with this tool or with javascript function or any other tool in your knowledge.

Thanks
viral316
 
Posts: 4
Joined: Wed May 03, 2017 5:31 pm

Re: Rename Folders content to Parent Folder Name_Sequential

Postby JavierMon » Mon Jul 24, 2017 5:19 pm

Admin wrote:Remove Name = Name (2) with Name : Remove


How did I now know this!? Thanks Admin.
JavierMon
 
Posts: 1
Joined: Tue Jul 18, 2017 11:33 am


Return to Javascript Renaming


cron