LACMIP / emu

5 stars 1 forks source link

Nested tables #2

Closed ekrimmel closed 5 years ago

ekrimmel commented 5 years ago

Original email:

Hi Bill,

We are finding the nested table structure within EMu difficult to work with, and wonder if you have any ideas on what we could do to work smarter, or else give us peace of mind that it is what it is and there's nothing we could be doing better.

The problem is anytime we want to edit a row in one column of a nested table based on the value of the row in another column of the nested table. For instance, Lindsay is working on updating a bunch of insect fossil names and she needed to be able to batch update the Identified By from "unknown" to "W. D. Pierce" and add values for Date Identified and Comments on the original type specimen IDs (i.e. those where Filed As = "Yes"). Some of these specimens also have a second ID row because their taxonomy has been updated, which means that Lindsay had to do what I would consider a pretty awkward workaround to accomplish her goal:

  1. Global replace Date Identified = blank --> Date Identified = "1954"
  2. Global replace "first occurrence only" Identified By = "unknown" --> Identified By = "PLACEHOLDER"
  3. Global replace "first occurrence only" Comment = blank --> Comments = "PLACEHOLDER"
  4. Global replace Identified By = "unknown" --> Identified By "W. D. Pierce"
  5. Global replace Identified By = "PLACEHOLDER" --> Identified By "unknown"
  6. Global replace Comment = blank --> Comments = "...[text]..."
  7. Global replace Comment = "PLACEHOLDER" --> Comments = blank

See irn = 2094730 for an example of a record that was fixed. The above works, but introduces a lot of opportunities for making mistakes with global replace, not to mention takes many more times longer than it should. Any ideas? I know we've discussed the same issue before in other modules, and for some of the instances you've been able to show us a smarter workaround.

ekrimmel commented 5 years ago

Bill's response:

This is easier as an export and re-import, especially if there are many records to change. Imports also allow you to check and test your data, and your import file is a nice copy of what you've done. I'll work out the steps and send it to you soon.