09-15-2011 09:32 AM
Hi i am having data like this
"good work done <123.http> by <lpo;"340> nani <//,89:789> kumar
now i wnat to remove the data in between these symbols < >
"good work done by nani kumar
09-15-2011 10:56 AM
And, if you're not used to using regular expressions, the following is an example using your data with the code suggested in that post:
informat string $80.;
input string &;
good work done <123.http> by <lpo;"340> nani <//,89:789> kumar
now <dfkljdfj> is the <jkfiuoiewurk> time for it
data want (drop=rx);
if _n_ eq 1 then rx = prxparse('s/<[^>]*>//');
string = prxchange(rx,100,string);
09-16-2011 10:58 AM
SAS has excellent documentation:
and there are lots of SGF papers on regular expressions and SAS. Suggest you go there first as it is available 24/7.
09-16-2011 01:23 PM
DLing is correct about reference the documentation that is available. I will explain that regular expression briefly.
substitute, look for < that is not immediately followed by > but has any other string inbetween another >, replace with nil
Also by using the prxdebug function you will get nice information in your log about what it is doing, can help you understand, maybe.