Forgot password? | Forgot username? | Register

Global replace into empty fields?

Global replace into empty fields?

Hiya:

so I had a bunch of records where I needed to add text to blank fields. I wanted to do a global replace to replace the empty fields with my text. However, that option was not allowed using the Replace function (the "OK" button was greyed out unless I typed something in there). Is there a different way to do this, or could it be added to that function?
Perian Sully
Judah L. Magnes Museum
Berkeley, California

Edited by: - 01-Jan-70 09:00:00

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Hi Perian,

You could use a regular expression to specify an empty field. In the substitution window of your global replace,
in the text to find: field, type ^$ , which essentially means that the text is to start and end with nothing, therefore an empty field. In the Replace with: field, enter the text that you want to replace the field with. At the bottom of the Substitution window under the Options group box, you will have to check Regular expression.

Let me know if you have any problems with the above.

Thanks,
Sylvia

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Hello Perian,
In the wizard, enter the following
Field: the field name you want to replace text into
Text to find: ^$ - this is the code to say 'an empty string', ^ means starts with, $ means ends with
Replace with: foo

Be sure to check 'Regular expression' donw below, otherwise it won't do your request. try one and when you are sure, do the rest.

I hope that helps,
Joanna

Joanna McCaffrey
Biodiversity Informatics Mgr.
useravatar
Offline
39 Posts
Female  Birthday  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Hi All,

A word of warning about this!
It's something I stumbled upon during a recent training session I was giving the curation team in methodology for cleaning up Sites data.

Apparently the standard fields within the Continental hierarchy are multi-valued. [Don't ask me why, perhaps KE could explain?] Whilst they may not behave as such, behind the scenes they are. So say for example you have a list of Sites records that need editing. Some have a value in Country, others don't. You want to fill in the Country value into all those records that have a blank.
One would think that a global replace that specifically says "replace a blank with value" would ignore all those records that already have a value in the Country field? Oh NO!!!
Since the Continental hierarchy fields are multi-valued, the system finds the next row in the multi-valued Country field (which is blank)and inserts the replacement value.

This obviously holds true for all other multi-valued fields.

cheers

Dave

Dave Smith
Earth Sciences Data Manager
Natural History Museum, London

David Smith
Earth Sciences Data Manager
useravatar
Offline
52 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

How odd. FWIW, in the AMNH implementation these fields appear to be ordinary single-value atomic fields. I confirmed this (for Country at least) by doing a "Replace All" on Country; EMu reported only changing 2 out of the 3 records in the set (the unchanged one already had a value in it.) I also exported the data via a CSV report and found only Country name listed for each record. Perhaps these fields were (unintentionally?) set as table fields in just your implementation?

Regards,
Tom Trombone
AMNH Ornithology
Thomas J. Trombone
American Museum of Natural History

Thomas Trombone
Data Manager, Ornithology
useravatar
Offline
54 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

I believe that the original KE EMu design for Sites did include Table of Text for various Sites fields in the Continental (Political) group. When I was at NMNH, this was the standard structure until that museum migrated to the new Sites that combines Sites and Collections Events (CES) where these fields then became single-value. The multi-value Sites fields are probably part of any standard EMu implementation. The single-value Sites fields are optional, but I'm sure someone from KE will clarify. If your institution opts to go with the single-value Sites down the road, this could involve a data migration as data from multi-value fields must be moved to single-value fields. And reports referencing these fields will need to be updated. This is what NMAI will probably have to do in the future.

Ducky (NMAI)

CIS Manager / EMu whipping girl

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

thanks everyone for the quick answers to my question!
Perian Sully
Judah L. Magnes Museum
Berkeley, California

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Hi Perian,
In additionan to Joanna's instructions for your substitution also tick check the box for "First Occurance Only". The replace will then happen once per record.
regards,
Lee-Anne
Museum Victoria
Australia

Lee-Anne Raymond
DAMS Manager (Acting)
useravatar
Offline
21 Posts
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Hello Ducky,

As you rightly point out the original Sites module (esites) has multi-value fields for the Continental group. The reason for this is that the first client to use esites indicated they would require multiple values for some of the fields (in particular states/provinces and townships). The reasoning was that a site may well cross state/township borders. In this case all states/townships would need to be listed in the hierarchy. Back then EMu did not allow a combination of single value and multiple value fields in a hierarchy (addressed many years ago now) all fields had to be multi-valued.

It was after a number of new clients indicated they did not want multiple value support we changed the controls in the Sites module to only allow a single value (but you could add multiple by entering SHIFT+ENTER to go to the next line). We could not change the columns however as some clients wanted multiple values and reports already accessed the columns.

When requests for a merged Collection Events and Sites module were considered, it was decided to make the new Continental group single-valued only. This was possible as the merged module actually uses the Collection Events table, not the Sites one, so we were only adding new columns (hence making sure everything was still backwards compatible).

Thus clients who use the Sites module (like NMAI, etc) have multi-valued hierarchies, while clients who use the merged Collection Events and Sites module (like AMNH) have single-valued hierarchies.

Regards

bern.

Posted By DucPhong Nguyen on 31-03-2007 1:08 AM
I believe that the original KE EMu design for Sites did include Table of Text for various Sites fields in the Continental (Political) group. When I was at NMNH, this was the standard structure until that museum migrated to the new Sites that combines Sites and Collections Events (CES) where these fields then became single-value. The multi-value Sites fields are probably part of any standard EMu implementation. The single-value Sites fields are optional, but I'm sure someone from KE will clarify. If your institution opts to go with the single-value Sites down the road, this could involve a data migration as data from multi-value fields must be moved to single-value fields. And reports referencing these fields will need to be updated. This is what NMAI will probably have to do in the future.

Ducky (NMAI)



Bernard Marshall
KE Software
Melbourne, Australia

Bernard Marshall (Axiell Melbourne)
useravatar
Offline
43 Posts
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Is there a way to enter carriage returns into the "replace with" data? I'm trying to replace the blank Provenance field for some works, but the new value is in three parapgraphs. How do I insert line breaks?

Mark Bradley – Assistant Registrar, Documentation (EMu)
National Gallery of Australia

Mark Bradley
Assistant Registrar (EMu Guy)
useravatar
Offline
147 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

I don't know the answer to your question (though I'd like to) but as a workaround you could use the Import tool to update the affected records instead. The documentation for the Import tool specifically explains how to import data containing the Carriage Return/New Line combination.
Thomas J. Trombone
American Museum of Natural History

Thomas Trombone
Data Manager, Ornithology
useravatar
Offline
54 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

I think the way to get a carriage return is \n

Tracy
Springs Preserve

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Thanks Tracy - i just tried this, but no joy, I simply ended up with "\n" in serted in the text. Unless I'm doing it incorrectly. I tick "Regular Expression" but that didn't help.

I think the the wildcards and special characters (like the ^$ outlined above) are used to find the terms to replace, not in the "replace with" box. Surely there's a way to insert special characters in the "replace with" box?

Mark Bradley – Assistant Registrar, Documentation (EMu)
National Gallery of Australia

Mark Bradley
Assistant Registrar (EMu Guy)
useravatar
Offline
147 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Oh - we are on 3.1.1, so no import tool yet.

Mark Bradley – Assistant Registrar, Documentation (EMu)
National Gallery of Australia

Mark Bradley
Assistant Registrar (EMu Guy)
useravatar
Offline
147 Posts
Male  Website 
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Global replace into empty fields?

Hi Mark, that is correct.. you cannot put line feeds in by using the Replace function. My only suggestion would be to put the text in without the line feed and then re-import it later when you have upgraded your version of EMu!

cheers
-Karen Biddle
Powerhouse Museum

Karen Biddle
Registrar / Collecion DB Admin
useravatar
Offline
109 Posts
Female  Website 
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic