Page 1 of 1

How to reverse Place data

Posted: 08 Jan 2011 21:14
by childe
Due to a limited understanding of how to use FH I have entered all my Place data in reverse. For example, instead of Leeds, West Yorkshire, England, I have entered England, West Yorkshire, Leeds.

In some cases, where I had it, I have added specific address details after the town name. I did all this solely because it seemed to be an easier way to manage places/addresses. However, firstly I have just discovered the button that allows the data to be reversed in the Tools, Work with Data, Places window, and secondly this is now causing me problems using my place data. It also means I have far more places than I should have as many Towns appear multiple times with different addresses.

So now I want to reverse all my place data (to show Town, City, County, Country, in that order), and then move the address data into the Address field.

Is there an easy way to do this or will I have to do each Place one by one? And Record by Record? Please say there is an easy way as I have hundreds of records and places.

Thanks

Eric

ID:4932

How to reverse Place data

Posted: 08 Jan 2011 21:57
by Jane
There is not currently a way to do all place fields with in Family Historian, but you could use the Tools/Work With Places option to do it a place at a time rather than on a record by record. If you know some one who can program a bit they might be able to write a quick tool to at least reverse the place contents.

How to reverse Place data

Posted: 08 Jan 2011 22:21
by tatewise
There is an easy way using PSPad (or any text editor with Regular Expressions).

1) Take a copy of your GEDCOM .ged file to another folder

2) Download and install PSPad from http://www.pspad.com/en/

3) Run PSPad and use menu bar File > Open to open your copied .ged file.

4) Use menu bar Search > Replace and tick Regular Expressions Option.

5) In the Find: box enter 2 PLAC (.*), (.*), (.*), (.*), (.*)$

6) In the Replace: box enter 2 PLAC $4, $3, $2, $1n2 ADDR $5

7) Ensure Prompt Each Replace option is ticked and click OK then click Yes for each replacement

8) If it looks like the PLAC fields are being reversed and an ADDR tag is being added, then click YesToAll

9) Use File > Save and then close PSPad

10) Double click the edited .ged file to open Family Historian and check the Place and Address fields appear OK

11) When happy copy the .ged file back to the project folder

If you need any further help then post here.
If you really get stuck I am prepared to accept an E-mailed copy of your .ged and carry out the edit.

How to reverse Place data

Posted: 08 Jan 2011 23:59
by childe
Wow! Thanks for the prompt responses.

Thanks Jane - that is what I have been doing for the last 2 hours or so since posting this question. However I realised that before doing as you have suggested I need to strip out the address details into the Address field, and I need to do that person by person. So far, starting at A, I have reached D. So this will take a while. At least it is then easy to reverse what remains in Place name field, and after stripping out the address details there won't be nearly as many of them.

Tatewise - your proposal looks interesting, especially if I can make it prompt me for each change. This will be necessary given I have already made some changes, so they no longer all need reversing. I'll give it a go tomorrow when I am not so tired.

Thanks again both, your help is much appreciated.

How to reverse Place data

Posted: 09 Jan 2011 12:05
by tatewise
Eric, before you venture into editing with PSPad the following may help.

1) In the FHUG Knowledge Base there is more on PSPad at:
http://www.fhug.org.uk/wiki/doku.php?id ... pad_editor

2) In my step 5) above the Find: regular expression assumes every Place/PLAC sub-field is separated with a comma (,) and a space ( ).
You could check and edit this using FH Tools > Work with Data > Places > Edit.
Alternative use the following regular expressions without spaces:
Find:        2 PLAC (.*),(.*),(.*),(.*),(.*)$
Replace: 2 PLAC $4,$3,$2,$1n2 ADDR $5
You can use FH Tools > Work with Data > Places > Edit afterwards to correct any inconsistencies.

3) It may be less tedious to revert to an earlier database rather than selectively PSPad edit the partially edited one.
Use FH File > Backup/Restore > Restore and select a backup from before you started editing Places and restore it to the folder in which you are using PSPad. Then if the first few edits work OK you can select YesToAll.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

If you are interested in changes other members would like for Place and Address fields, see the FHUG Wish List menu item top left. In the Search For box enter the following numbers in turn and click >.
  8   59   69   132   249   417
Then double click on the entry to open its details.

If you are interested in creating a single data source for each identical Fact Address then see my Forum topic Place and Address References at:
http://www.fhug.org.uk/cgi-bin/index.cg ... y&num=4706

How to reverse Place data

Posted: 09 Jan 2011 20:28
by childe
As usual, my impetuosity got the better of me and I was well down the road before I saw your second email. In fact I had already stripped out all the address details. Also, I have not been consistent in using the same number of levels for each place; they vary from 1 to 6. So I could not use PSPad in quite the way you suggested. However by slightly modifying your suggested Search/Replace strings I was able to reverse most of my place entries. I started by searching for all with 6 levels, then 5 levels, then 4 and so on. As you can imagine this got pretty tedious as I had to do each one individually, but it was quicker than manually reversing them in the FH programme.

So, thanks to you, I am now nearly done. I have another question regarding Places, but I will create a new thread for that one.

Thanks again

Eric