Page 1 of 1
Find and Replace for in Source Notes [Solved]
Posted: 13 Aug 2018 07:51
by Gowermick
After an exercise in tidying my Source Records, a lot of them now have duplicated entries in the Note field.
For example, where I had 'Have Image' in a Source Note, after combining them, somehow the single entry now contains
'Have Image Have Image Have Image...', the number of repeats dependant upon how many citations used the Source.
Is there a way of using Find and Replace to remove this unwanted text e.g. Find 'Have Image', Replace with '' ?
I tried ticking the 'Note' option in Find and Replace, but that seems to be restricted to Individual notes. I can do it manually, but thought there must be a better way.
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 08:17
by Jane
If might be helpful to go to the All tab for the source and open all the branches and post a screen shot for us, I suspect the "repeats" are actually in multiple notes or perhaps in the Text from Source field?
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 08:31
by Gowermick
Jane,
Sadly not.
I think in the early days of FH, moving from FTM, I ran a few 'Tidy Up' routines, and whereas I had multiple copies of a source, each containing a single 'Have Image' in note field, after tidying up, I had one source, but multiple copies of 'Have Image', one from each of the original sources.
As you can see from the screen-shot, I only have one Note field.
I am removing the Notes manually, but looking to see if, in principle, one could use 'Find and Replace' in source Note fields.
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 08:48
by davidm_uk
You could always edit your ged file with a text editor (eg Notepad), and use the replace function there. Of course you'd have to be careful if you have the 'Have Image' text anywhere else.
Make a copy of your ged file first, just in case!
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 08:52
by tatewise
Assuming they are all multiple Have Image entries, use the Search and Replace Plugin, where on Extra Filters you can specifically select Note fields for Source (SOUR.NOTE).
However, for me Edit > Find and Replace works with just Notes ticked, so don't understand why it does not work for you.
Yes, you can edit GEDCOM but that is fraught with risks.
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 08:53
by Gowermick
David,
Yes I did think of that (I use
Geany, which is also ideal for writing LUI plugins)

but felt it too much hassle. I was really after a better way of doing it in FH!
Mike
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 08:54
by Jane
When I search using the standard find and replace it finds have image just fine

- 2018-08-13_095338.jpg (33.17 KiB) Viewed 6756 times

- 2018-08-13_095311.jpg (93.64 KiB) Viewed 6756 times
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 09:06
by Gowermick
tatewise wrote:
However, for me Edit > Find and Replace works with Notes ticked, so don't understand why it does not work for you.
Mike,
I tried
Find again, with Notes ticked and this time it DID find them. I must have been too impatient the last time I tried, as everything but Census types showed up!
I'll now try the
Find and Replace again, and see what happens.
Update: Although
Find found the 'Have Image' note in source note field, '
Find and Replace' made '0' replacements! (one for Calico Pie?)
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 09:15
by DavidNewton
Try the following settings in the Search and Replace plugin - ignore the vertical cursor after the * I missed it when I took the screen shot

- HaveImage.JPG (78.35 KiB) Viewed 6751 times
The pattern matches all note beginning with "Have Image " and replaces them with "Have Image". If it doesn't do what you expect then undo the plugin updates.
David
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 09:19
by tatewise
Not sure it is one for Calico Pie, because both Jane and I can Find and Replace exactly that text OK.
David's solution is a variant method, but does not need LUA Pattern Mode.
A simple Plain Text Mode search for Have Image with blank replace will work just fine.
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 09:28
by DavidNewton
My mistake. I misunderstood the question and thought the idea was to remove the duplicates, keeping one.
David
Re: Find and Replace for in Source Notes
Posted: 13 Aug 2018 09:55
by Gowermick
Mike,
Following on from your comment that
Find and Replace worked for you, and having deleted all 'Have Image' notes manually, I re-entered one or two to test
Find and Replace again, and it did work! It even updated the source record list I had open as it went, without need for a refresh.
I can only assume human error on my part

However, I'll be more careful next time, now I know it definitely works!
Thanks