[Archivesspace_Users_Group] Duplicate Commas Following Description

Blake Carver blake.carver at lyrasis.org
Fri Aug 10 15:52:41 EDT 2018


We've run into those a few times and found an update to the tables was the way to go. Depending on where those pesky commas are showing up it would be something like this:

mysql> UPDATE archival_object
    -> SET display_string = replace(display_string, ',,', ','), system_mtime = now() where display_string like '%,,%';

mysql> UPDATE archival_object
    -> SET title = TRIM(TRAILING ',' FROM title), system_mtime = now() where title like '%,';

mysql> UPDATE date
    -> SET expression = TRIM(TRAILING ',' FROM expression), system_mtime = now() where expression like  '%,';

Using either TRIM or REPLACE should do the trick.

Dave's idea of using the API is also another option.

-Blake



________________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Danielle Butler <dbutler at cals.org>
Sent: Friday, August 10, 2018 12:21:22 PM
To: Archivesspace Users Group
Subject: [Archivesspace_Users_Group] Duplicate Commas Following Description

In Archivists’ Toolkit before migrating to ASpace, we manually added commas to the end of each description element, so that there would be commas between the description and date elements in our XSL style sheet. When we migrated to ASpace all of the commas are duplicated in display, because ASpace automatically inserts a comma (so nice!).

To have cleaner data going forward I would like to remove that comma and just add something to the style sheet to insert the comma at the end of each description element (which is what we likely should have been doing all along anyway). I have never run a script on a dataset, but I imagine that it should be fairly uncomplicated to remove the last character from a particular table using some sort of a script. We are running 2.3.2 on a Windows Server using a MySQL database.

Does anyone have any experience doing such a thing and could perhaps provide some guidance?

Thank you,

Danielle Butler, CA | Archivist
Butler Center for Arkansas Studies | Central Arkansas Library System
www.butlercenter.org<http://www.butlercenter.org/>
100 Rock Street
Little Rock, AR 72201
501-320-5724



More information about the Archivesspace_Users_Group mailing list