* importing gedcom + media from MyHeritage

Importing from another genealogy program? This is the place to ask. Questions about Exporting should go in the Exporting sub-forum of the General Usage forum.
avatar
OlivierM
Diamond
Posts: 54
Joined: 30 Jan 2023 04:33
Family Historian: V7
Location: Brussels
Contact:

Re: importing gedcom + media from MyHeritage

Post by OlivierM »

First of all, I thank you again for your fantastic support
tatewise wrote: 14 Nov 2023 22:56 - the files are not visible anymore...
It must be more than just the upper case JPG which should work OK.
There must be some space or other characters involved.
One option is to revert your Project to its pre-plugin state and I will fix the plugin.
Alternatively, you can use the Search and Replace plugin but it must search for more than just JPG and must focus on just the Media Format field otherwise other fields may get corrupted.
Do you need advice on how to set the plugin options?
I verified, but it is really the switch between JPG and jpg that makes the difference.
I would of course appreciate if you modify the plugin, but I feel it would be a good thing for me to better understand the way the Search and Replace plugin works, so I would love your advice on how to set the plugin options in order to replace the "JPG" format by "jpg" without corrupting the data.
tatewise wrote: 14 Nov 2023 22:56 - I notice now I have many duplicate title names...
The plugin will detect the problem and will not rename files with duplicate filenames.
It will say "Media file rename failed" and leave the Media record and filename unaltered.
So you need to ensure all Media Titles are unique before running the plugin.
Please run the Check for Possible Duplicated Media plugin attached to viewtopic.php?p=113053#p113053 to check if any of your URL derived files are actually duplicates and the Media records can be merged.
I tried to use the Check for Possible Duplicated Media plugin without accepting the merge, and since I get the attached error message, even after closing and reopening the project:
image.png
image.png (29.92 KiB) Viewed 350 times
I started with Reunion 30 yrs ago, later TMG.
I now use FH as my main software, TNG and MyHeritage to share my data.
Transkribus to decipher old texts.
Genealogica Grafica, The Complete Genealogy Builder and My Family Tree to view and check my data.
User avatar
tatewise
Megastar
Posts: 27593
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: importing gedcom + media from MyHeritage

Post by tatewise »

The Search and Replace plugin settings needed are as follows:

Set the Search Scope to Multimedia Records (OBJE) to focus on just Media records.

On the Extra Filters tab ensure only the Multimedia Format & Place Hierarchy fields filter is ticked.

On the Major Options tab select LUA Pattern Mode because I think there are rogue characters in the Format.

Set Search: to .*JPG.* to match any leading or trailing rogue characters as well as JPG.
Set Replace: to jpg to set the lowercase Format.

Click the Search & Replace button and click Replace to confirm each replacement.
If the first few replacements look OK then untick Confirm every item found and click Replace to convert the rest.


Sorry about the plugin error message. It may be caused by an old version of the table data file.
Anyway, try the updated attachment.
Last edited by tatewise on 24 Nov 2023 17:13, edited 1 time in total.
Reason: Attachment deleted as a better version is attachd to thread 'Is there an easier way to use merge'
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
OlivierM
Diamond
Posts: 54
Joined: 30 Jan 2023 04:33
Family Historian: V7
Location: Brussels
Contact:

Re: importing gedcom + media from MyHeritage

Post by OlivierM »

tatewise wrote: 15 Nov 2023 11:50 The Search and Replace plugin settings needed are as follows:

Set the Search Scope to Multimedia Records (OBJE) to focus on just Media records.

On the Extra Filters tab ensure only the Multimedia Format & Place Hierarchy fields filter is ticked.

On the Major Options tab select LUA Pattern Mode because I think there are rogue characters in the Format.

Set Search: to .*JPG.* to match any leading or trailing rogue characters as well as JPG.
Set Replace: to jpg to set the lowercase Format.
Thank you !

It worked as a charm, simply by searching JPG in plain text and with the other settings you recommended.
I started with Reunion 30 yrs ago, later TMG.
I now use FH as my main software, TNG and MyHeritage to share my data.
Transkribus to decipher old texts.
Genealogica Grafica, The Complete Genealogy Builder and My Family Tree to view and check my data.
avatar
OlivierM
Diamond
Posts: 54
Joined: 30 Jan 2023 04:33
Family Historian: V7
Location: Brussels
Contact:

Re: importing gedcom + media from MyHeritage

Post by OlivierM »

A last question:

I still have about 400 media files where the TITL tag = equal to the file name and has a length of 131 characters like this:

AxZjNhMWUzZDYxNzJhNjMwZjgyMmQ0N2QzNDUxZTNjYzU5OTc5OWY0N2JmZTlkODgxZTYmZT0xNjk3OTU4MDAw_024_768_4651_500685_03430058e1220y661p6920_A

Is there a way to rename in bulk all these files by cutting the first 100 characters and the 18 last characters?

Thank you in advance.
I started with Reunion 30 yrs ago, later TMG.
I now use FH as my main software, TNG and MyHeritage to share my data.
Transkribus to decipher old texts.
Genealogica Grafica, The Complete Genealogy Builder and My Family Tree to view and check my data.
User avatar
Valkrider
Megastar
Posts: 1547
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: importing gedcom + media from MyHeritage

Post by Valkrider »

Others may come up with an alternative way. Open a copy of your Gedcom file in Notepad++ and use its search and replace function to look for the title and delete the characters at the beginning and then repeat with the characters at the end. Open that gedcom in FH and make sure everything is ok. If it is then repeat on your 'live' gedcom.
User avatar
tatewise
Megastar
Posts: 27593
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: importing gedcom + media from MyHeritage

Post by tatewise »

I think it could be done with the Search and Replace plugin and rename the files as well as the Title.
However, the Media would still have meaningless numerical Titles and filenames.

I would advise taking your time and manually give the Media records meaningful Titles.
Yes, it will take a while but only needs to be done once.

Another possible solution relies on those Media being linked to Source records.
In that case, consider the Rename Selected Source Media plugin from the Plugin Store.
That uses the Source record Title as the basis for the Media record Title and filename.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
OlivierM
Diamond
Posts: 54
Joined: 30 Jan 2023 04:33
Family Historian: V7
Location: Brussels
Contact:

Re: importing gedcom + media from MyHeritage

Post by OlivierM »

tatewise wrote: 16 Nov 2023 15:49 I would advise taking your time and manually give the Media records meaningful Titles.
Yes, it will take a while but only needs to be done once.
You are right (as usual) But before giving the media meaningful titles, I want to get rid of these absurd long file names.
I started with Reunion 30 yrs ago, later TMG.
I now use FH as my main software, TNG and MyHeritage to share my data.
Transkribus to decipher old texts.
Genealogica Grafica, The Complete Genealogy Builder and My Family Tree to view and check my data.
User avatar
tatewise
Megastar
Posts: 27593
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: importing gedcom + media from MyHeritage

Post by tatewise »

After you have given them new Titles you can run the Rename Selected Media Files plugin as before to use the Titles as the filenames!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
OlivierM
Diamond
Posts: 54
Joined: 30 Jan 2023 04:33
Family Historian: V7
Location: Brussels
Contact:

Re: importing gedcom + media from MyHeritage

Post by OlivierM »

tatewise wrote: 16 Nov 2023 15:49 I think it could be done with the Search and Replace plugin and rename the files as well as the Title.
However, the Media would still have meaningless numerical Titles and filenames.
I temporarily accept the meaningless dimension of these names. But how do I create them ?
I know that the lua string function I must use on the titles with a long name is string.sub(s,101,113) but I do not know how to apply it in the search and replace plugin.

Could you please help me out of this ?
I started with Reunion 30 yrs ago, later TMG.
I now use FH as my main software, TNG and MyHeritage to share my data.
Transkribus to decipher old texts.
Genealogica Grafica, The Complete Genealogy Builder and My Family Tree to view and check my data.
User avatar
tatewise
Megastar
Posts: 27593
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: importing gedcom + media from MyHeritage

Post by tatewise »

You cannot apply Lua functions to the Search and Replace plugin and must use Lua patterns as explained in FHUG KB Understanding Lua Patterns.

So to match any N characters you must use the dot . pattern repeated N times.

To capture the 13 characters that are 18 characters from the end of the text use:
Search: .+(.............)..................$
Replace: %1

In the Search Scope, use Select Records to choose just the Media with those long names.

On the Extra Filters tab, as well as the Multimedia Format & Place Hierarchy fields option, also tick on the right the Record Names/Titles > Multimedia (~FILE.TITL) option so that the File link, filename, and Media Title all get changed together.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
OlivierM
Diamond
Posts: 54
Joined: 30 Jan 2023 04:33
Family Historian: V7
Location: Brussels
Contact:

Re: importing gedcom + media from MyHeritage

Post by OlivierM »

Thank you Mike !

The TITL field is changed, but the file names are not changed: I think I would have to tick the "multimedia linked file fields and media fields " to achieve this. I tried, but it yields poor results because it also replace the directory path (media/ ...) and the suffix (*.jpg).

So I prefer to change the TITL field with the "search and replace "plugin, and then run the "Rename selected media files" plugin.

Again, thank you for your continuous support
I started with Reunion 30 yrs ago, later TMG.
I now use FH as my main software, TNG and MyHeritage to share my data.
Transkribus to decipher old texts.
Genealogica Grafica, The Complete Genealogy Builder and My Family Tree to view and check my data.
User avatar
tatewise
Megastar
Posts: 27593
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: importing gedcom + media from MyHeritage

Post by tatewise »

Ah! :oops: You are correct. That pattern match won't work for both the Title and the Filename Link.
I was trying to propose the solution too quickly without enough analysis.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply