DATA Step, Macro, Functions and more

add space between a long string

Accepted Solution Solved
Reply
Contributor
Posts: 65
Accepted Solution

add space between a long string

I have a very long string variableand I want a space aftr each comma. Is there a way to do it? Thanks! below is just a part of my long string:

042,042.,042.0,079.53,279.10,279.19,795.71,795.8,V08,V08.,140,140.1,140.3,140.4,140.5,140.6,140.8,140.9,141,141.1,141.2,141.3,141.4,141.5,141.6,141.8,141.9,142,142.1,142.2,142.8,142.9,143,143.1,143.8,143.9,144,144.1,144.8,144.9,145,145.1,145.2,145.3,145.4,145.5,145.6,145.8,145.9,146,146.1,146.2,146.3,146.4,146.5,146.6,146.7,146.8,146.9,147,147.1,147.2,147.3,147.8,147.9,148,148.1,148.2,148.3,148.8,148.9,149,149.1,149.8,149.9,150,150.1,150.2,150.3,150.4,150.5,150.8,150.9,151,151.1,151.2,151.3,151.4,151.5,151.6,151.8,151.9,152,152.1,152.2,152.3,152.8,152.9,153,153.1,153.2,153.3,153.4,153.5,153.6,153.7,153.8,153.9,154,154.1,154.2,154.3,154.8,155,155.1,155.2,156,156.1,156.2,156.8,156.9,157,157.1


Accepted Solutions
Solution
‎02-22-2017 11:13 AM
Frequent Contributor
Posts: 75

Re: add space between a long string

Posted in reply to zhuxiaoyan1
WantString=tranwrd(HaveString,',',', ');

View solution in original post


All Replies
Solution
‎02-22-2017 11:13 AM
Frequent Contributor
Posts: 75

Re: add space between a long string

Posted in reply to zhuxiaoyan1
WantString=tranwrd(HaveString,',',', ');
Contributor
Posts: 65

Re: add space between a long string

Posted in reply to nehalsanghvi
Thank you so much!

Xiaoyan
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 164 views
  • 0 likes
  • 2 in conversation