Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line fields for Search and Replace strings? #2

Open
bondjimbond opened this issue May 3, 2016 · 4 comments
Open

Multi-line fields for Search and Replace strings? #2

bondjimbond opened this issue May 3, 2016 · 4 comments

Comments

@bondjimbond
Copy link

I attempted to use this module to correct a problem in about 1500 of our records, where a carriage return was mistakenly added in the field, resulting in poor display in search results.

MODS datastream example: (link)

Wanted to change:
<note> The original print copy of this thesis

to:
<note>The original print copy of this thesis

But in the single-line search string field, the carriage return was converted to a space, and the search returned no results. (I tried using different ways of representing the carriage return character, but nothing seems to work.)

Would turning these short text fields into long text fields resolve this problem?

@mitchmac
Copy link
Contributor

mitchmac commented May 8, 2016

Hmmm, I've updated the Search and Replace fields to textareas for an unrelated issue. Maybe try that though it's possible that Drupal is trimming the the whitespace from the form input?

@bondjimbond
Copy link
Author

Doesn't seem to have helped...

It did paste properly into Search Text field:

The original print copy of this thesis

But running the search returned the same result -- No matching objects were found. Search again.

@jennifer-bradshaw
Copy link

jennifer-bradshaw commented Nov 12, 2021

Hi.

In the MODS datastream, I want to change the role for one contributor from "contributor" to "host institution". There are other contributors that I don't want to touch, so I have to include the name field as well as the role field.

I've tried a variety of ways (deleting spaces, deleting line returns, etc.) to find and replace, but I do not get results.

Original:

<namePart>University of Iowa. Libraries. Map Collection</namePart>
    <role>
      <roleTerm authority="marcrelator" type="text">contributor</roleTerm>

Desired result:

<namePart>University of Iowa. Libraries. Map Collection</namePart>
    <role>
      <roleTerm authority="marcrelator" type="text">host institution</roleTerm>

I think Find and Replace doesn't find any matches because of the line breaks in the MODS. Has anyone figured out how to do multi-line find and replace?

Thanks.
Jennifer

For reference the full code for the field looks like this:

 <name type="corporate" authority="lcsh">
    <namePart>University of Iowa. Libraries. Map Collection</namePart>
    <role>
      <roleTerm authority="marcrelator" type="text">contributor</roleTerm>
    </role>
  </name>

@bondjimbond
Copy link
Author

I haven't used this module for quite a long time now, because https://github.com/ulsdevteam/islandora_datastreams_io does a better job. I use this to export all the MODS datastreams I'm interested in, make the complex replacements on my computer with more powerful tools, and then re-upload them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants