* Media renaming

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile
Post Reply
avatar
PKF
Newbie
Posts: 4
Joined: 14 Sep 2021 11:07
Family Historian: V7

Media renaming

Post by PKF » 14 Sep 2021 11:32

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: 22362
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise » 14 Sep 2021 11:47

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
Newbie
Posts: 4
Joined: 14 Sep 2021 11:07
Family Historian: V7

Re: Media renaming

Post by PKF » 14 Sep 2021 15:37

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: 22362
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise » 14 Sep 2021 16:35

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: 22362
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise » 14 Sep 2021 16:56

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
Newbie
Posts: 4
Joined: 14 Sep 2021 11:07
Family Historian: V7

Re: Media renaming

Post by PKF » 14 Sep 2021 20:16

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: 22362
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise » 14 Sep 2021 21:01

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 174 times

Only the one option shown must be ticked.

SearchandReplaceExtraFilters.png
SearchandReplaceExtraFilters.png (83.03 KiB) Viewed 174 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
peterbel
Famous
Posts: 222
Joined: 21 Nov 2014 20:24
Family Historian: V7
Location: Menheniot Cornwall

Re: Media renaming

Post by peterbel » 15 Sep 2021 11:23

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: 22362
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Media renaming

Post by tatewise » 15 Sep 2021 12:09

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
Famous
Posts: 222
Joined: 21 Nov 2014 20:24
Family Historian: V7
Location: Menheniot Cornwall

Re: Media renaming

Post by peterbel » 15 Sep 2021 14:19

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
Newbie
Posts: 4
Joined: 14 Sep 2021 11:07
Family Historian: V7

Re: Media renaming

Post by PKF » 16 Sep 2021 09:16

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
Superstar
Posts: 370
Joined: 17 Jan 2009 19:14
Family Historian: V6.2
Location: UK

Re: Media renaming

Post by davidf » 16 Sep 2021 09:45

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 (Lubuntu 18.04 LTS)

Post Reply