View previous topic :: :: View next topic

Author 
Message 
vijay
New User
Joined: 13 Aug 2003 Posts: 1




Hi,
I need a rexx function with identifying all substrings in the string that start with %HLQS and end with a ',' ' ' '+' or ')'
STR1="AFTER ( %HLQS.A.B.1,%HLQS.A.B.2,%HLQS.A.B.3 +
output would be : %HLQS.A.B.1 %HLQS.A.B.2 %HLQS.A.B.3
STR2=" %HLQS.A.B.4,%HLQS.A.B.5,%HLQS.A.B.6 +
output would be : %HLQS.A.B.4 %HLQS.A.B.5 %HLQS.A.B.6
STR3=" %HLQS.A.B.7,%HLQS.A.B.8,%HLQS.A.B.9.0)
output would be : %HLQS.A.B.7 %HLQS.A.B.8 %HLQS.A.B.9.0
thanks,
vijay 

Back to top 




dick scherrer
Site Director
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix




Hello,
I suspect your examples are rather incomplete, but if what you show is what you want, why not simply change a quote or a comma or a plus etc to a space?
Kinda late and i may have misunderstood. . . 

Back to top 


Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 1697 Location: UK




WORDPOS, VERIFY, INDEX. WORDPOS would be best 

Back to top 


expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8593 Location: Back in jolly old England




A simple use of the TRANSLATE and WORD function 

Back to top 


Bill Woodger
DFSORT Moderator
Joined: 09 Mar 2011 Posts: 7162




You have a block of text which looks like this:
Code: 
AFTER ( %HLQS.A.B.1,%HLQS.A.B.2,%HLQS.A.B.3 +
%HLQS.A.B.4,%HLQS.A.B.5,%HLQS.A.B.6 +
%HLQS.A.B.7,%HLQS.A.B.8,%HLQS.A.B.9.0)

And you want it to look like this:
Code: 
%HLQS.A.B.1 %HLQS.A.B.2 %HLQS.A.B.3
%HLQS.A.B.4 %HLQS.A.B.5 %HLQS.A.B.6
%HLQS.A.B.7 %HLQS.A.B.8 %HLQS.A.B.9.0

This would be an "editor job" as a onceoff.
Edit macro? The editing suggestions you've already had if using rexx? Depends what you want it for. 

Back to top 


