Forum

Please or Register to create posts and topics.

Script to Remove Trailing WhiteSpace from Text Columns

The description of the script is in the comments in the .sql file.

The motivation is that I have abandoned for now my efforts to convert my current RM7 database to RM8 and then to test reverting it to RM7. There apparently is some malformation in my RM7 database that is causing the process to fail, and neither Tom nor I can figure out what the problem is. If instead I go from my current RM7 database to a new RM7 database using GEDCOM and go from there to RM8, then Tom's script to revert from RM8 to RM7 works great. Apparently, the GEDCOM step cleans up whatever is wrong with my database.

But using GEDCOM in the process has problems of its own. One of those problems is that the ActualText column in my RM7 database (both in SourceTable and CitationTable) has a lot of trailing white space that is lost in GEDCOM. I'm fine with the lost of trailing whitespace in this case except that it makes it very difficult to run my new scripts that compare databases. The trailing whitespace came from copying and pasting text into the ActualText column and I don't need it. So I'm just deleting it. The same script could be adapted easily to remove trailing white space from any other column.

Uploaded files: