Take away leading and trailing spaces.

From TNG_Wiki
Jump to navigation Jump to search

This will take away any leading or trailing space in names, dates, or where ever.

Copy and paste the text between the lines into the MySQL section of your MySQL admin, IMPORTANT: Make a backup before you try anything and use this at your own risk!


update tng_people set lastname = trim(lastname);
update tng_people set lnprefix = trim(lnprefix);
update tng_people set firstname = trim(firstname);
UPDATE tng_families SET husband = trim( husband);
UPDATE tng_families SET wife = trim( wife) ;
UPDATE tng_families SET familyID = TRIM( familyID) ;
UPDATE tng_children SET familyID = TRIM( familyID) ;
UPDATE tng_children SET personID = TRIM( personID) ;
UPDATE tng_people SET personID = TRIM( personID) ;
UPDATE `tng_people` SET `sex` = "F" WHERE `sex` like "F%";
UPDATE `tng_people` SET `sex` = "M" WHERE `sex` like "M%";
UPDATE `tng_people` SET `sex` = "U" WHERE `sex` like "U%";
UPDATE tng_families SET marrplace = TRIM(marrplace);
UPDATE tng_families SET divplace = TRIM(divplace);
UPDATE tng_people SET birthplace = TRIM(birthplace);
UPDATE tng_people SET altbirthplace = TRIM(altbirthplace);
UPDATE tng_people SET deathplace = TRIM(deathplace);
UPDATE tng_people SET burialplace = TRIM(burialplace);
UPDATE tng_events SET eventplace = TRIM(eventplace);
UPDATE tng_places SET place = TRIM(place);
UPDATE tng_xnotes SET note = TRIM(note) ;
UPDATE tng_citations SET note = TRIM(note) ;
UPDATE tng_citations SET citetext = TRIM(citetext) ;
UPDATE tng_medialinks set personID = TRIM(personID);
UPDATE tng_families SET marrplace = TRIM(marrplace);
UPDATE tng_families SET divplace = TRIM(divplace);
UPDATE tng_people SET birthplace = TRIM(birthplace);
UPDATE tng_people SET altbirthplace = TRIM(altbirthplace);
UPDATE tng_people SET deathplace = TRIM(deathplace);
UPDATE tng_people SET burialplace = TRIM(burialplace);
UPDATE tng_events SET eventplace = TRIM(eventplace);