* Bulk adding source data

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
User avatar
craigmollekin
Famous
Posts: 247
Joined: 06 Mar 2009 00:28
Family Historian: V6.2
Location: Rotherham, South Yorkshire, England
Contact:

Bulk adding source data

Post by craigmollekin » 20 Sep 2014 05:43

Hi,

Is there any way to add the same source data to multiple records?

The only way I can currently think of is by exporting a Gedcom to a new Gedcom with the new source data and then merging it back.
Craig Mollekin

I'd rather look for dead people than have them look for me.

User avatar
tatewise
Megastar
Posts: 27089
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Bulk adding source data

Post by tatewise » 20 Sep 2014 09:17

Do mean adding a Citation to the same Source Record from many Individual Records or Facts.

If so, then Copy an existing Citation and Paste it wherever you want it using the Copy and Paste icons/buttons on the yellow Sources pane.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
craigmollekin
Famous
Posts: 247
Joined: 06 Mar 2009 00:28
Family Historian: V6.2
Location: Rotherham, South Yorkshire, England
Contact:

Re: Bulk adding source data

Post by craigmollekin » 20 Sep 2014 09:22

No, I mean I have 4500 people that I'd like to add a citation to ;-)
Craig Mollekin

I'd rather look for dead people than have them look for me.

User avatar
DavidNewton
Superstar
Posts: 462
Joined: 25 Mar 2014 11:46
Family Historian: V7

Re: Bulk adding source data

Post by DavidNewton » 20 Sep 2014 11:29

Although this may not be what you are looking for it seems to me that if you are making 4,500 copies then you should consider creating a source (Method 1) rather than a citation (Method 2). Attaching a source to a list of people, as a <whole record> source is fairly simple as a plugin - with a bit of preparation.

1. Create the source
2. Create a named list of the individuals
3. Run the following rough and ready plugin

fs=fhNewItemPtr()
tsour=fhPromptUserForRecordSel('SOUR',1)
tsel=fhPromptUserForRecordSel('INDI')
for i=1, #tsel do
fs=fhCreateItem('SOUR',tsel,true)
fhSetValueAsLink(fs,tsour[1])
end

When the plugin asks for the list go to the Named lists tab and double click your named list.
I'm afraid I don't have a file with 4,500 individuals so cannot test this on a data set of that size so take the usual backup precautions should you decide to try it.

David

User avatar
tatewise
Megastar
Posts: 27089
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Bulk adding source data

Post by tatewise » 20 Sep 2014 13:04

Yes, that Plugin approach is the neatest method.

It results in every one of the 4,500 Individual Records having a <whole Record> Citation, and each one links to the chosen Source Record.

I have tried it on some sample data and it certainly works fine.

I am fascinated as to why all 4,500 have a common Source.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
craigmollekin
Famous
Posts: 247
Joined: 06 Mar 2009 00:28
Family Historian: V6.2
Location: Rotherham, South Yorkshire, England
Contact:

Re: Bulk adding source data

Post by craigmollekin » 21 Sep 2014 00:46

Thanks for the replies and for creating that, David. I will try it in the next few days and report back :)

The Gedcom in question contains 4500ish people transcribed from headstones from a single person. I just wish to acknowledge them as the source of the data before adding additional data to it :D
Craig Mollekin

I'd rather look for dead people than have them look for me.

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

Re: Bulk adding source data

Post by PeterR » 21 Sep 2014 08:29

If it was me, I would have each headstone as a Source record, with citations by one or more Individuals or Families, and by one or more Facts (birth, death, etc.) for each Individual. Presumably there are a lot less than 4,500 headstones and thus Source records. A Source record cannot itself have a Source, but they could all have an Author. I'm sure the Plugin can be adapted to do that instead.
Peter Richmond (researching Richmond, Bulman, Martin, Driscoll, Baxter, Hall, Dales, Tyrer)

User avatar
craigmollekin
Famous
Posts: 247
Joined: 06 Mar 2009 00:28
Family Historian: V6.2
Location: Rotherham, South Yorkshire, England
Contact:

Re: Bulk adding source data

Post by craigmollekin » 21 Sep 2014 08:41

Well, I took the photos of the headstones but somebody has transcribed the names and dates for me from the photos of the headstones. I'm just wanting the transcribed data to be associated with the person who transcribed them :-)
Craig Mollekin

I'd rather look for dead people than have them look for me.

User avatar
DavidNewton
Superstar
Posts: 462
Joined: 25 Mar 2014 11:46
Family Historian: V7

Re: Bulk adding source data

Post by DavidNewton » 21 Sep 2014 09:10

I do agree about the citations but I also think as far as possible we should avoid repetition of details. I don't know if this is relevant but I have a transcription list of memorials and a source record which contains all the common details and then use citations to refer to the individual items. (I am certain that everyone will have their own way of detailing this).

David

Oh and before anybody else points it out I will be changing the image location to a more appropriate Sources > BMD :(
Attachments
Capture.PNG
Capture.PNG (26.25 KiB) Viewed 6019 times

User avatar
tatewise
Megastar
Posts: 27089
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Bulk adding source data

Post by tatewise » 21 Sep 2014 09:29

Follow-up on the PeterR comment "A Source record cannot itself have a Source, but they could all have an Author."

It is true a Source Record cannot have a Source, but its Note field can cite a Source.
Unfortunately, this Citation does not appear in the yellow Sources pane of the Source Record Property Box.

Alternatively, a Source Record can link to a Note Record which appears on the Notes tab of its Property Box.

I assume Craig does have a separate Source Record for each tombstone.
So I would be tempted to create a Note Record detailing the transcription acknowledgements.
Then link this one Note Record to each Source Record using the Plugin method.

Code: Select all

fs=fhNewItemPtr()
tnote=fhPromptUserForRecordSel('NOTE',1)
tsel=fhPromptUserForRecordSel('SOUR')
for i=1, #tsel do
 fs=fhCreateItem('NOTE',tsel[i],true)
 fhSetValueAsLink(fs,tnote[1])
end
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
tLeodiensian
Platinum
Posts: 31
Joined: 03 Dec 2004 18:02
Family Historian: V7
Location: Pudsey, West Yorkshire.

Re: Bulk adding source data

Post by tLeodiensian » 27 Mar 2022 19:42

I'd love to use this as it is exactly what I want to do.
I have a named list and want to add a source link to all the individuals in it (~ 250).

1. Create the source
2. Create a named list of the individuals
3. Run the following rough and ready plugin

fs=fhNewItemPtr()
tsour=fhPromptUserForRecordSel('SOUR',1)
tsel=fhPromptUserForRecordSel('INDI')
for i=1, #tsel do
fs=fhCreateItem('SOUR',tsel,true)
fhSetValueAsLink(fs,tsour[1])
end

When the plugin asks for the list go to the Named lists tab and double click your named list.


However, when I run it I get a plugin error :-
"path_to_script....];5: bad argument #2 to 'fhCreateItem' (fh.PITEM expected, got table). No changes made...."

What is the change needed in the above code to allow the loop to read from a named list (aka a table) instead of selecting separate individuals, as seems to have been David Newton's original intent ?

I don't claim to be coder, MD-DOS batch files or Linux bash scripts are my limit, so I'd like some help here.
I also see that this was posted in 2014, and FH has moved on, so there might need to be other tweaks. I'm on latest V7.

Thanks in advance
Doug Whiteley - Researching mostly in Yorkshire.
PCs use Manjaro or Debian Linux with Cinnamon desktop, FH & AS accessed via Remote Desktop hosted on a Windows 11 "box", that is accessible from anywhere in the house on any device.

User avatar
tatewise
Megastar
Posts: 27089
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Bulk adding source data

Post by tatewise » 27 Mar 2022 20:15

That is a near-perfect first shot.

The problem is the tsel variable that is a table or array of pointers to the Individual records selected using the Named List.
Whereas, the fhCreateItem(...) function needs just one of those pointers, not the whole table.
Similar to the way you chose tsour[1] as the source pointer.
You could have used:

Code: Select all

fhCreateItem('SOUR',tsel[i],true)
but there is a neater way, so replace the for i=1, #tsel do and fhCreateItem(...) statements with:

Code: Select all

for i, psel in pairs (tsel) do
fs=fhCreateItem('SOUR',psel,true)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
tLeodiensian
Platinum
Posts: 31
Joined: 03 Dec 2004 18:02
Family Historian: V7
Location: Pudsey, West Yorkshire.

Re: Bulk adding source data

Post by tLeodiensian » 27 Mar 2022 20:46

Thanks,

Just what I wanted, and so quick to reply.

Thanks again.

Doug
Doug Whiteley - Researching mostly in Yorkshire.
PCs use Manjaro or Debian Linux with Cinnamon desktop, FH & AS accessed via Remote Desktop hosted on a Windows 11 "box", that is accessible from anywhere in the house on any device.

Post Reply