* Media renaming

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
PKF
Silver
Posts: 5
Joined: 14 Sep 2021 11:07
Family Historian: V7

Media renaming

Post by PKF »

I have named media files in the format of Event, name, place, year is it possible to rename these files say in the format of name, event, place, year.
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise »

Welcome to the FHUG.

To make that type of change two entities must change simultaneously to avoid breaking the links to the files.
  1. The filename of the Media file saved within the Media folder of your Project.
  2. The link to that file held in the File link field of the Media record in the Project GEDCOM.
The Search and Replace plugin from the Plugin Store will perform that simultaneous change.
It also has the ability to recognise format patterns in the filename and rearrange that format.
However, whether that will work in your case will depend on the exact details of your format.

See the FHUG Knowledge Base advice on Family Historian Plugins for download and installation instructions.

Please post the details of your current filename format focussing on delimiters between components and the format of each component, together with some examples. Then we can explain how to use the plugin.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
PKF
Silver
Posts: 5
Joined: 14 Sep 2021 11:07
Family Historian: V7

Re: Media renaming

Post by PKF »

Hi, thanks for a quick response.
In answer to your question I haven’t used any delimiters, I just named a file name such as “Census William Boulter Leicester 1911” just using spaces to separate
Last edited by tatewise on 14 Sep 2021 16:51, edited 1 time in total.
Reason: Corrected example file name
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise »

I suspect that may make bulk conversion a bit tricky but let us investigate further.
It is crucial to specify the formats precisely otherwise the format pattern matching will not work as expected.

We can get the pattern matching to work if your Event names are always one word followed by a space.
Also, the Place must be one word followed by a space, i.e. Milton Keynes would not work successfully.
e.g.
The pattern matching would be 'one-word-Event' 'any Name with spaces' 'one-word-Place' '4-digit-year'
Then the matching components can be rearranged to form the changed filename.

That pattern would match your “Census William Boulter Leicester 1911” example correctly.
But “Census William Boulter Milton Keynes 1911” would think the Name is William Boulter Milton and the Place is Keynes.

Does that make sense?

What should be possible is to handle all the Place names with an internal space using a variant of the pattern matching that allows one space within the Place component. But those cases must be selected for conversion separately from all the others.
Last edited by tatewise on 14 Sep 2021 16:54, edited 1 time in total.
Reason: Changed to match revised file name format
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise »

Did you understand the strategy?

I do need to double-check that you are talking about Media file names and NOT the FH Media record Titles.

It would also help to know if you are a very new FH user, or have been using FH a while but only just joined the FHUG.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
PKF
Silver
Posts: 5
Joined: 14 Sep 2021 11:07
Family Historian: V7

Re: Media renaming

Post by PKF »

Yes the strategy makes sense.
They are media file names.
I’ve been using FH for a while but only just joined the FHUG
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise »

Below are shown the settings needed in the Search and Replace plugin. See the Help & Advice for details.
But as I said earlier, the Patterns only work if all Event and Place components are single words. Is that the case?
If not, then you will need to use Select Records to restrict the scope.

The Search Pattern probably needs some explanation unless you are familiar with regular expressions.
\(%a+)·([%a·]+)·(%a+)·(%d%d%d%d)%. where:
\ matches the \ character just before the file name
(%a+) matches any letters forming the Event and the parentheses capture that Event
· matches one space delimiter
([%a·]+) matches letters and spaces forming the Name and the parentheses capture that Name
· matches one space delimiter
(%a+) matches any letters forming the Place and the parentheses capture that Place
· matches one space delimiter
(%d%d%d%d) matches a four digit Year and the parentheses capture that Year
%. matches the dot between file name and type (. is 'magic' symbol so needs escaping with %)

The Replace Pattern defines the replacement text drawn from the captured text.
This is a different format than you proposed but makes future reformatting much easier.
\%2,·%4·%1·in·%3. where:
\ is the \ character
%2 is the 2nd capture of the Name
is a comma space delimiter (optional)
%4·%1· are the 4th and 1st capture of Year and Event both terminated with a space
in·%3. is the word in and the 3rd capture of Place terminated with a dot

To achieve your original proposed format use \%2·%1·%3·%4.

SearchandReplaceMajorOptions.png
SearchandReplaceMajorOptions.png (52.61 KiB) Viewed 3136 times

Only the one option shown must be ticked.

SearchandReplaceExtraFilters.png
SearchandReplaceExtraFilters.png (83.03 KiB) Viewed 3136 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
peterbel
Superstar
Posts: 348
Joined: 21 Nov 2014 20:24
Family Historian: V7
Location: Cornwall

Re: Media renaming

Post by peterbel »

I did a similar media renaming process a while ago when I realised my 'convention' had been a bit random.
I chose "1855 DCert Fred Bloggs Place" as my new 'standard' as it seemed faster to lookup the media record I wanted as I had fewer in a particular year (1855), than of particular type (DCert). I also asked the Forum members for assistance having already started (!) and Jane came up with a useful Plugin which renamed the Media File with the Title I had given it in FH.
viewtopic.php?f=32&t=18407

It worked for me back then but you will have to check with Jane if it is good for your FH version.
Tracing the Devon Bellamy family along with their partners.
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise »

Peter, that plugin simply aligns the Media filename & Link to match the Media record Title.
You had manually reformated all your Media Titles before realising you needed to align the Links & filenames.
If you had used the Search and Replace plugin before those manual changes it may have been possible to change the Title, Link & filename in bulk all at the same time.

PKF has said nothing about Media Titles yet and hopefully will mention any changes needed for them before making the Link & filename changes.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
peterbel
Superstar
Posts: 348
Joined: 21 Nov 2014 20:24
Family Historian: V7
Location: Cornwall

Re: Media renaming

Post by peterbel »

Of course you are right, I really wanted to comment on the 'convention' as much as anything.
They are media file names.
Also Jane's Plug-In might be copying in the wrong direction, not sure from PKF's post
Last edited by tatewise on 15 Sep 2021 14:54, edited 1 time in total.
Reason: Corrected PKF typo
Tracing the Devon Bellamy family along with their partners.
avatar
PKF
Silver
Posts: 5
Joined: 14 Sep 2021 11:07
Family Historian: V7

Re: Media renaming

Post by PKF »

Having looked at my file naming for Media Records again I see that in fact I have not always followed the convention I stated I.e. Event Name Place Year so I don’t think bulk renaming is going to work.

Can I rename records individually by going to the Edit Media Box and just changing the title

Secondly is there a set convention for naming these fields?
User avatar
davidf
Megastar
Posts: 951
Joined: 17 Jan 2009 19:14
Family Historian: V6.2
Location: UK

Re: Media renaming

Post by davidf »

Why worry about the name of the actual media file because as soon as it is attached to a Media Record, the media record becomes the "thing" you work with within FH?

The naming of media records can be almost whatever you like. On the Media Record tab (and elsewhere) the Filter on title box works on the "contains" basis - so enter "Certificate" and it will find all media records that contain the word "Certificate".

One advantage of leaving media files with the name they had on acquisition is that it becomes easier to spot duplication. For instance, if you have previously downloaded a census page from Ancestry/FMP etc. and attached it to a media record, should you try and download that page again - you will get a "file name exists" type error message from your operating system - which will prompt you to search in your existing media records for the previous occasion you acquired that census page. Either you will be inadvertently duplicating work (and people) you have previously researched or you have found a neighbour who has become of relevance - either realisation is useful!
David
Running FH 6.2.7. Under Wine on Linux (Ubuntu 22.04 LTS + LXDE 11)
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise »

What davidf says is good advice.

PKF, you are now talking about changing the Media record Title field, which only has an impact within the FH data.
So you are free to change the Title fields to anything you wish.

That is completely different from the File link field that refers to the Media file name.
That File link only appears in the Media Window, the Media tab of the Records Window, the Media Property Box, or in the Tools > External File Links... list. It does not appear in the Edit Media window.

There is no established convention for naming Media, partly because there are so many possible types of Media.
Firstly there are different file types including image files, PDF, Word-processor documents, audio and video files.
Then there are Media about people such as family photos, pictures of places such as gravestones, and copies of source documents such as Certificates and Census returns.

Have you considered using Ancestral Sources for capturing the most popular events and associated Media?
It has templates for ensuring source document Media is named consistently to whatever format you prefer.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
PKF
Silver
Posts: 5
Joined: 14 Sep 2021 11:07
Family Historian: V7

Re: Media renaming

Post by PKF »

Yes thanks I was getting mixed up between Media Titles and Filenames thinking they were one and the same. It probably started when I was downloading things such as a census extract from Fmp/ancestry and I changed the filename to something I could understand particularly if I downloaded more than one file before i used them on FH.
So a bit of a change of mindset when downloading files!
I do use Ancestral Sources so I will need to have a look to se if I’m using it correctly

Thanks for everybody’s input
avatar
Gowermick
Megastar
Posts: 1702
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Media renaming

Post by Gowermick »

The problem with davidf’s suggestion is that the same census image from different webistes will have different names provided by them, so you could still end up with two copies of the same image!

i rename ALL my downloads to the same format, so soon know if I already have it, especially census images.
When I add the source to the census fact, if the source already exists, I know I already have the image, which I rename to my own format.
E.g. 1841 census image file name is in format 1841 0123 F09-21 P 21.jpg, which is similar to the source name HO107 Piece 0123/09 Folio 21 Page 21. These filename will bear no resemblance to those given by Ancestry or FMP!

NB I don’t link these images to FH, in case I want to re-organise my file storage at some point. To me, the hassle of resetting the FH image links at the same time just doesn’t make it worthwhile!
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise »

Mike, providing you keep the same file names, you can reorganise the folder structure and easily mend the broken FH File links.
The Tools > External File Links... Auto Repair Links button has been available in FH v6.2 for some time and performs that automatic correction.
It is often used when migrating from PC to PC where Media files are outside the FH project folder and the file paths are different on the target PC (they nearly always are different).
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
davidf
Megastar
Posts: 951
Joined: 17 Jan 2009 19:14
Family Historian: V6.2
Location: UK

Re: Media renaming

Post by davidf »

Gowermick wrote: 16 Sep 2021 16:00 The problem with davidf’s suggestion is that the same census image from different webistes will have different names provided by them, so you could still end up with two copies of the same image!
True, but my workflow tends to be trying to do everything via FMP first and if I can't find (or can't read) the relevant page, I look elsewhere (e.g. Ancestry), so either the "page" is original or is "same but different" - hopefully more readable.

The big advantage as far as I am concerned is that you don't have to mess around with file name formats - just drop everything into the media folder with the default name and use the media record title to do all the distinguishing. When a website does not "play nice" and offers to download "image.jpg" - I curse because I have to think up a unique name!
David
Running FH 6.2.7. Under Wine on Linux (Ubuntu 22.04 LTS + LXDE 11)
Post Reply