Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (http://www3.telus.net/pfrank)
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Facebook photos: batch renaming to useful filenames (SOLVED)

 
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions
View previous topic :: View next topic  
Author Message
arjaydavis



Joined: 02 Jan 2012
Posts: 7

PostPosted: Mon Jan 02, 2012 3:37 am    Post subject: Facebook photos: batch renaming to useful filenames (SOLVED) Reply with quote

Scenario:
I work with a journalist friend who writes and photographs for travel and art subjects. He uses his Facebook profile to post the photographs.

We are developing his content on other platforms to attract a larger audience: flickr and his own website.

To help him minimise uploading pictures on all platforms I download the photos from his Facebook and republish them on the other platforms.

However, the Filenames given by Facebook are a long underscore separated string of numbers, e.g.: 297978_10150935169935366_674695365_21667071_49502726_n.jpg

This is not very attractive and will appear as the title in flickr.

Manually renaming of each file in the album is a big repetitive task, so Pfrank to the rescue!

Put the files into a folder named as the gallery - this name will be reused in the filenames along with a counter to make each file unique

1) Here's the list of files:



2) Here are the PFrank renamer settings:



In plain text these are the following in the List:

#1:
Search pattern:
([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_n.jpg
Replace pattern:

#2:
Search pattern:

Replace pattern:
*Insert Folder before*Prefix*

#3:
Search pattern:

Replace pattern:
*Insert Counter after*All*

#4:
Search pattern:
(.*)

Replace pattern:
1\.jpg




Notes:

List step #1 removes the facebook filename
List step #2 puts the containing folder/directory name into the filename
List step #3 appends the counter to make the file unique
List step #4 appends the .jpg extension

- you'll see some of the Search pattern: and Replace pattern: are empty - this is deliberate so leave blank
- In Menu Option View->Options you can set the delimiter as underscores _ or something else and counter increment ascending/descending to suit your requirement


3) Preview how PFrank has renamed the files:



4) You may want to log the original filenames from facebook and how they "map" to the new names - for traceability/audit reasons. Pfrank provides for the ability to select all the files in the preview, then using CTRL-C you can copy the list to the clipboard and paste it into a text editor.

But you may want to hide some of the other columns first:



5) Just the old filename (from Facebook) and new Filename here:



6) In the Pfrank rename preview window select all the files so they are highlighted (do this e.g. by left click on the top then hold down SHIFT and click the last, bottom file to select all). Then CTRL-C the files in PFrank Renamer, CTRL-V into a text editor



7) Click rename in the PFrank renamer window and yes to the bulk rename warning.

Resultant files:




Another, even better option, is to add facebook app functionality to external site that the photos are intended for. This is possible if the site is Drupal-based (using the http://www.drupalforfacebook.org/ suite of modules ). This could provide automation, and also export the captions.

But in the meantime there is PFrank for the renaming.

Solution also posted on superuser.com here:
http://superuser.com/questions/373690/facebook-photos-batch-renaming-to-useful-filenames-using-pfrank-powerful-free-r


Last edited by arjaydavis on Mon Jan 02, 2012 4:07 am; edited 1 time in total
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Mon Jan 02, 2012 3:45 am    Post subject: Reply with quote

Nicely done and thanks for the post at superuser.com.

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arjaydavis



Joined: 02 Jan 2012
Posts: 7

PostPosted: Mon Jan 02, 2012 2:49 pm    Post subject: Reply with quote

Thanks.

Getting the counter ascending numbering to increment based on file modification date/time stamp is important for photo sharing uploaders as they may order the photos by time/date stamp, e.g. as in Flickr. If the counter had been numbered against the filename sorting then they would appear out of sync.

I found this useful post on the subject, solved by you:
http://pfrank.s4.bizhat.com/viewtopic.php?t=132&highlight=counter
Back to top
View user's profile Send private message
arjaydavis



Joined: 02 Jan 2012
Posts: 7

PostPosted: Wed Jan 11, 2012 6:56 pm    Post subject: actually, facebook photo download files end with _o and _n Reply with quote

so in the regex use \w instead of the _n as stated to catch both...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Regular Expressions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com