Rename PDF files according to its titles and authors

Bulk Rename Utility How-To's

Rename PDF files according to its titles and authors

Postby Jakov » Sun Dec 13, 2020 6:06 pm

Hi All

Please I have a list of academic pdf files (around 2500) of books, journals ...etc
Is there any way to rename these pdf files according to its titles, authors, year ...etc (its metadata).

Thanks in advance
Jakov
 
Posts: 54
Joined: Sat May 23, 2020 1:29 am

Re: Rename PDF files according to its titles and authors

Postby Luuk » Mon Dec 14, 2020 12:31 am

Greetings Jakov. The experts saying that if Windows can present the file properties, then so can the javascript also reads them. Im not can get Windows to present these properties for the pdf files, so if its not working, you can also use the exiftool.exe with experiments like...
Code: Select all
exiftool -overwrite_original -ext pdf -d "%Y" -TESTname"<${Title;} by ${Author;} on ${CreateDate}%-c.%le"  "YourFolderPath"
This presents to the screen like... 'Old-Name.pdf' -> 'Title by Author on 2020.pdf'.
If to join more ${Metadata;} making the names satisfactory, it can then be safe changing -TESTname into -Filename.
Luuk
 
Posts: 705
Joined: Fri Feb 21, 2020 10:58 pm

Re: Rename PDF files according to its titles and authors

Postby Admin » Mon Dec 14, 2020 6:51 am

Hi, yes it can be done using BRU and Add(7). What properties would you like to use? Please see "Using Windows File Properties to Rename Files" in BRU help file.

Extract here:

With Bulk Rename Utility you can read and use the Windows File Properties to rename your files. More information on the Windows Property System that can be set on Windows files can be found here:https://docs.microsoft.com/en-us/windows/win32/properties/props

Windows File Properties are only available on Windows Vista or newer.

*** To enable Windows File Properties tags support in Bulk Rename Utility, activate the option 'Extract Windows File Properties' from the Renaming menu.

To show a list of all available file properties, for a file or a file type, in Bulk Rename Utility, right-click on a file in the main file list and select 'Show List of File Properties' from the popup context menu.


Alternatively, you can also see the file properties of a file in Windows Explorer: right-click on a file and select "Properties" and then "Details".



Each file property has three entries: a LABEL, a VALUE and a NAME. You can select a file property by LABEL or by NAME and then use its VALUE to rename a file.



Using File Properties in Add (7)



You can use the file properties in Add(7) as tags. To enable Windows File Properties tags support in Bulk Rename Utility, activate the option 'Extract Windows File Properties' from the Renaming menu.
To use a file property, specify the file property like this: <(propertylabel)> or <(propertyname)>. The tag will be replaced by the property value for that property.


For instance :
Prefix : <(System.Photo.CameraManufacturer)> might add "OLYMPUS" as a prefix.

Suffix : <(System.Image.HorizontalSize)> might add "3648 pixels" as a suffix.

Prefix : <(Title)> might add the file title as a prefix.


The file properties can be referred to by Label or Name. They can be used in Add(7) -> Prefix, Suffix, Insert.

IMPORTANT: You can also specify some extra characters in the property < > tag. For instance, "<(Subject) - >" will add the Subject and the - , but only if the subject is not empty. If (Subject) is empty, the whole tag < > will be empty. This is different from using "<(subject)> -". In this case - will always be added even if the file does not have a subject.



File Properties as Dates and Numbers

If you want to add a file property to a file name as a date or as a number, use the property formatting markers.

# will format a property as a number. If a file property value has numbers and letters, the letters will be ignored.
$ will format a property as a date, according to the date and time formatting options as specified in Auto-Date (8).



For instance :
Prefix : <($System.Photo.DateTaken) - > will add the date taken as prefix followed by - , formatted according to values in Auto-Date (8).

Suffix : < - (#ISO speed)> might add " - 100" as suffix. The file property is added as number only.

Suffix : < - (ISO speed)> might add " - ISO100" as suffix. The file property is added as a text string.



Clipboard

A special tag is <clip> which is replaced by the current text content of the Windows Clipboard.



Using File Properties in Javascript


For more complex uses, besides just adding certain file properties to file names with Add (7), also Javascript and Javascript Conditions support Windows file properties, via the functions fileProperty, filePropertyDate, filePropertyNum. See Javascript Renaming for more information.
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: Rename PDF files according to its titles and authors

Postby Jakov » Mon Dec 14, 2020 6:26 pm

Luuk wrote:Greetings Jakov. The experts saying that if Windows can present the file properties, then so can the javascript also reads them. Im not can get Windows to present these properties for the pdf files, so if its not working, you can also use the exiftool.exe with experiments like...
Code: Select all
exiftool -overwrite_original -ext pdf -d "%Y" -TESTname"<${Title;} by ${Author;} on ${CreateDate}%-c.%le"  "YourFolderPath"
This presents to the screen like... 'Old-Name.pdf' -> 'Title by Author on 2020.pdf'.
If to join more ${Metadata;} making the names satisfactory, it can then be safe changing -TESTname into -Filename.


Thank you so much my bro
Best Regards
Jakov
 
Posts: 54
Joined: Sat May 23, 2020 1:29 am

Re: Rename PDF files according to its titles and authors

Postby Jakov » Mon Dec 14, 2020 6:28 pm

Admin wrote:Hi, yes it can be done using BRU and Add(7). What properties would you like to use? Please see "Using Windows File Properties to Rename Files" in BRU help file.

Extract here:

With Bulk Rename Utility you can read and use the Windows File Properties to rename your files. More information on the Windows Property System that can be set on Windows files can be found here:https://docs.microsoft.com/en-us/windows/win32/properties/props

Windows File Properties are only available on Windows Vista or newer.

*** To enable Windows File Properties tags support in Bulk Rename Utility, activate the option 'Extract Windows File Properties' from the Renaming menu.

To show a list of all available file properties, for a file or a file type, in Bulk Rename Utility, right-click on a file in the main file list and select 'Show List of File Properties' from the popup context menu.


Alternatively, you can also see the file properties of a file in Windows Explorer: right-click on a file and select "Properties" and then "Details".



Each file property has three entries: a LABEL, a VALUE and a NAME. You can select a file property by LABEL or by NAME and then use its VALUE to rename a file.



Using File Properties in Add (7)



You can use the file properties in Add(7) as tags. To enable Windows File Properties tags support in Bulk Rename Utility, activate the option 'Extract Windows File Properties' from the Renaming menu.
To use a file property, specify the file property like this: <(propertylabel)> or <(propertyname)>. The tag will be replaced by the property value for that property.


For instance :
Prefix : <(System.Photo.CameraManufacturer)> might add "OLYMPUS" as a prefix.

Suffix : <(System.Image.HorizontalSize)> might add "3648 pixels" as a suffix.

Prefix : <(Title)> might add the file title as a prefix.


The file properties can be referred to by Label or Name. They can be used in Add(7) -> Prefix, Suffix, Insert.

IMPORTANT: You can also specify some extra characters in the property < > tag. For instance, "<(Subject) - >" will add the Subject and the - , but only if the subject is not empty. If (Subject) is empty, the whole tag < > will be empty. This is different from using "<(subject)> -". In this case - will always be added even if the file does not have a subject.



File Properties as Dates and Numbers

If you want to add a file property to a file name as a date or as a number, use the property formatting markers.

# will format a property as a number. If a file property value has numbers and letters, the letters will be ignored.
$ will format a property as a date, according to the date and time formatting options as specified in Auto-Date (8).



For instance :
Prefix : <($System.Photo.DateTaken) - > will add the date taken as prefix followed by - , formatted according to values in Auto-Date (8).

Suffix : < - (#ISO speed)> might add " - 100" as suffix. The file property is added as number only.

Suffix : < - (ISO speed)> might add " - ISO100" as suffix. The file property is added as a text string.



Clipboard

A special tag is <clip> which is replaced by the current text content of the Windows Clipboard.



Using File Properties in Javascript


For more complex uses, besides just adding certain file properties to file names with Add (7), also Javascript and Javascript Conditions support Windows file properties, via the functions fileProperty, filePropertyDate, filePropertyNum. See Javascript Renaming for more information.


Iam can not thank you enough for your work
Thank you so so so much my bro
Best Regards
Jakov
 
Posts: 54
Joined: Sat May 23, 2020 1:29 am


Return to How-To