Page 1 of 1

Import Records and Remove Multiple Keywords from Library

Posted: Sun Jun 12, 2011 3:15 pm
by wtagg
Hello,

I'm working on getting up and running in Bookends. In order to do so I have several tasks that I need to accomplish. They are listed in order:

1) Import ~1000 records from a Sente database to a Bookends database
2) Remove the keywords from all of the records imported from Sente
3) Remove select keywords (preserving others) in an already existing Bookends database
4) Merge the recently imported records from Sente (w/ keywords removed) into the existing Bookends database

My question is specific but I wanted to provide context in case someone can identify a better way to go about this. My specific question relates to the removal of keywords in step #3:

How can I remove select keywords from the entire database while preserving others?

I've searched the forums and found a few queries about similar tasks (see http://bit.ly/kiYFdf and http://bit.ly/mlyR7c ). I've also searched the manual hoping to find out how this could be accomplished. This searching has led me to suspect that going to Refs-->Global Change-->Find and Replace and using REGEX would be the way to do this. However, I have very little practice using REGEX. I'm also unsure of how to obtain text of all the keywords in my current database that I could use in a Regular Expression.

One of the more promising discoveries was this post from Jon:

Q: How can I remove all keywords from a Bookends database?
A: "Use Global Change to put "" (empty) into the Keyword field of all references in the database. Do this on a COPY of your db, it is not undoable." (see http://bit.ly/jw1FPQ )

However, this would remove all of my keywords and I would like to do this selectively. If you have any suggestions about the steps I've outlined or about my specific question I would really appreciate hearing them. I'm looking to gain total control over the these references for a literature review I'm writing for my dissertation. Many of the keywords I receive from databases are meaningless to me and thus create a lot of noise when I use keywords and smart groups.

Best regards,

Will

Re: Import Records and Remove Multiple Keywords from Library

Posted: Sun Jun 12, 2011 5:29 pm
by Jon
Removing all keywords is easy (my post you quoted is the way to do it). Removing selected keywords indeed would use Global -> Find and Replace. But this doesn't involve using RegeX on your part. All database manipulation is done by Bookends, you just supply the characters to find in the Keywords field and tell Bookends to replace them with nothing.

Note that keywords is different from most fields in that it is a scrolling list of Return-separated entries. Therefore, you'll want to remove only whole lines. Remember that the ¬ character (Option-L on US keyboards) is interpreted as a Return by Bookends. So if you want to delete

United States

you'd enter

¬United States¬

Of course this will miss United States if it occurs on the first line. Likewise,

United States¬

would miss the term if it were on the last line. So be aware that if a term is used alot, you may need to do several passes.

Two important notes:

1. In working out this reply I realized that there is a bug in "Replace All" where the ¬ was not being treated as a Return properly. I have fixed this and just did a silent update with the fix. Please download Bookends 11.1.5 again if you want to do this.

2. Check the Keywords Term List to see if the terms you want removed have actually been removed. You need to update the Term List to see items that were removed (as opposed to added). To do this, open the Term List window and press Delete. Bookends will offer to update (it's very fast).

Finally, as I mentioned in the other post, do this on a COPY of your database, so if anything unexpected happens (you delete terms you wanted kept, or whatever) you can go back to the original.

Jon
Sonny Software

Re: Import Records and Remove Multiple Keywords from Library

Posted: Sun Jun 12, 2011 7:27 pm
by wtagg
Jon,

Thanks for your quick and detailed reply. I was able to use another approach to solve my problem but I'm still very glad to have the information for future reference. I'm so glad to be using Bookends again!

After attempting to "clean up" the keywords in my database, I noticed some issues that resulted in apparent duplicates of keywords. Basically, I had some keywords entered with trailing spaces/returns that meant that "Qualitative" and "Qualitative " (notice the empty space) both showed up as "Qualitative" in the Keywords view on the left. Is there any way to automate cleanup of issues like this? Or is this another issue that needs to be dealt with on a case-by-case basis with judicious use of regular expressions?

Will

Re: Import Records and Remove Multiple Keywords from Library

Posted: Sun Jun 12, 2011 9:53 pm
by Jon
I'm afraid that Bookends can't distinguish between keywords that end in a space and those that don't. This check is something I could add in the future, but as of now Bookends will consider them to be distinct keywords, and you'll have to merge them yourself (search for the one ending in the space and replacing with the one that doesn't).

Jon
Sonny Software

Re: Import Records and Remove Multiple Keywords from Library

Posted: Sun Jun 12, 2011 10:08 pm
by wtagg
Thanks, Jon. I don't necessarily mind the distinction that Bookends makes between a keyword that ends/doesn't end in a space. Although, if BE could be made to be "smart" about these differences that would be helpful. But I was wondering if you could suggest a way of removing those trailing spaces other than manually.

Re: Import Records and Remove Multiple Keywords from Library

Posted: Sun Jun 12, 2011 10:12 pm
by Jon
The only way I can think of is to go a find/replace for "keyword ¬" and replace with "keyword¬" (note the space before ¬).

Jon
Sonny Software

Re: Import Records and Remove Multiple Keywords from Library

Posted: Sun Jun 12, 2011 10:18 pm
by wtagg
Thanks. Should have thought of that. I appreciate your help.

Re: Import Records and Remove Multiple Keywords from Library

Posted: Mon Jun 13, 2011 7:36 am
by Jon
There actually is an easier way I should have mentioned. Open the Keywords Term List window and select the term you want to change. Use the Action popup menu (gear icon) and select Replace. Enter the new term (the one without a space) and Bookends will update your database and Term List accordingly.

Jon
Sonny Software

Re: Import Records and Remove Multiple Keywords from Library

Posted: Mon Jun 13, 2011 11:15 am
by wtagg
Thanks. That is actually a lot faster.

Re: Import Records and Remove Multiple Keywords from Library

Posted: Tue Jun 14, 2011 9:25 am
by Jon
I see that now you can't delete a term using the Term List window Replace function. I've modified this in the next update, and you will be able to remove terms using this mechanism (and it is a lot easier than the Global Find Replace because Bookends will take care of lines and Returns for you).

Jon
Sonny Software

Re: Import Records and Remove Multiple Keywords from Library

Posted: Tue Jun 14, 2011 11:38 am
by wtagg
Thanks again, Jon. It's great to get such a quick response and update.