Android Contacts – Remove Spaces / Line Breaks From Postal Address

| | |
UPDATE data
SET data1 = ltrim(ifnull(data4, '') || ' ' || ifnull(data5, '') || ' ' || ifnull(data6, '') || ' ' || ifnull(data7, '') || ' ' || ifnull(data8, '') || ' ' || ifnull(data9, '') || ' ' || ifnull(data10, ''))
WHERE mimetype_id IN (
		SELECT _id
		FROM mimetypes
		WHERE mimetype LIKE "%postal%"
		);
UPDATE data
SET data1 = REPLACE(replace(REPLACE(data1, x'0D0A', x'0A'), x'0D', x'0A'), x'0A', ' ')
WHERE mimetype_id IN (
		SELECT _id
		FROM mimetypes
		WHERE mimetype LIKE "%postal%"
		);
Originally Posted on February 21, 2014
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.