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 < >
output :
"good work done by nani kumar
Take a look at this similar post, it should provide your answer.
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:
data have;
informat string $80.;
input string &;
cards4;
good work done <123.http> by <lpo;"340> nani <//,89:789> kumar
now <dfkljdfj> is the <jkfiuoiewurk> time for it
;;;;
data want (drop=rx);
set have;
if _n_ eq 1 then rx = prxparse('s/<[^>]*>//');
retain rx;
string = prxchange(rx,100,string);
run;
Hi art can u tell me what
prxparse('s/<[^>]*>//'); is this means like 's/<[^>]*>//' and what prxchange will do ,can you expalin meSAS 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.
DLing is correct about reference the documentation that is available. I will explain that regular expression briefly.
s/<[^>]*>//
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.