 	valid_end_date,
 	invalid_reason
 	)
-SELECT DISTINCT SUBSTR(c.str, 1, 255) AS concept_name,
+SELECT DISTINCT TRIM(SUBSTR(c.str, 1, 255)) AS concept_name,
 	'Drug' AS domain_id,
 	'NDC' AS vocabulary_id,
 	'11-digit NDC' AS concept_class_id,

	SELECT concept_code,
		coalesce(startdate, min(l.ndc_valid_start_date)) valid_start_date,
		coalesce(enddate, max(h.ndc_valid_end_date)) valid_end_date,
		substr(coalesce(c_name1, c_name2, max(spl_name)), 1, 255) concept_name
	FROM (
		SELECT n.concept_code,
			n.startdate,

		CASE 
			WHEN MULTI_NONPROPRIETARYNAME IS NULL
				THEN CONCAT (
						SUBSTR(nonproprietaryname, 1, 100),
						CASE 
							WHEN length(nonproprietaryname) > 100
								THEN '...'
							END,
						NULLIF(' ' || SUBSTR(aggr_dose, 1, 100), ' '),
						' ',
						SUBSTR(routename, 1, 100),
						' ',
						SUBSTR(dosageformname, 1, 100)
						)
			ELSE CONCAT (
					'Multiple formulations: ',
					SUBSTR(nonproprietaryname, 1, 100),
					CASE 
						WHEN length(nonproprietaryname) > 100
							THEN '...'
						END,
					NULLIF(' ' || SUBSTR(aggr_dose, 1, 100), ' '),
					' ',
					SUBSTR(routename, 1, 100),
					' ',
					SUBSTR(dosageformname, 1, 100)
					)
			END AS concept_name,
		SUBSTR(brand_name, 1, 255) AS brand_name,
