Skip to content
Advertisement

Split string values with various length spearated spaces into three columns

My tableA col1 has three values and separated by various length. I need to separate it and into three columns and place it into Z1, Z2, and Z3 respectively. Also, on some individual value has spaces in between too for example ‘Windows XP Professional’ but I need it make it as individual value. Any ideas? See sample below.Thanks.

Current

After

Advertisement

Answer

Assuming there are at least TWO spaces between each “column”.

Cross Apply B will create a “clean” pipe delimited string” (Thanks Gordon!)

Cross Apply C will parse the new pipe delimited string into 3 columns

Example

Returns

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement