We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Parse / Separate data in a field to different fields which are separated by Char(13)

tvae
tvae asked
on
Medium Priority
269 Views
Last Modified: 2012-05-11
SHIP TO: JERRY DOE 1258 Academy Sq College Park,GA  30337

I need to separate to data stored in one field to multiple fields
 
SHIP TO: JERRY DOE as ShipName
1258 Academy Sq as Ship Address
College Park as ShipCity
GA as ShipState
30337 as Zip

The name , address and zip are separated by Char(13) and the city and state by ,
Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I am not so sure how to use the CHARINDEX. I tried that and was only successful to pull the first one but not sure how to grab the next group
after first one you will get 2 strings like below.

SHIP TO: JERRY DOE 1258 Academy Sq College Park
GA  30337

Again, Split the first string using CHARINDEX (Since u said that its CHAR(13)) and split the second string usng SPACE.

Refer the thread in my previous post.

Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.