04-12-2013 09:22 AM
hi i have the following data
-currrent or prior tre
-prior use of treat
i am trying to get rid of '-' hypen at starting of each value.
could any one please help me out to remove that.
04-12-2013 10:45 AM
However it worked but in my values there are '-' in middle too those are removing too.
so i just need to remove only the first position of value only For '-'.
04-12-2013 10:59 AM
04-12-2013 11:16 AM
Thanks Lin lin. but when I have "-" in the middle its getting removed too. For instance in the following example for the third value "-a-b" have "-" at the begining and the middle also.
When I tried the following code,
if first(v)='-' then v=compress(v,'-');
My output is :
but the required output is (i.e If there is any "_" in the middle other than first position I need to keep it as is)
04-12-2013 11:38 AM
try this one.
04-12-2013 12:28 PM
Hi Linlin and Tilea,
Thank both of you for your help. I really appreciate your input.
Could you please help me with the following one too.
AMD1_9-History of another malignancy within the previous 5 years other than curatively treated non-
melanomatous skin cancer
AMD1_10-Current or prior treatment with estrogens and/or drugs with anti-androgenic properties such
as spironolactone > 50mg/kg, or progestational agents for the treatment of prostate cancer less than 6
months prior to randomization .
In my variable sample I have two sets of values one is 7 char in length second set is 8 char in length
I need to just remove up to colon part and my variable should be starting from alphabets.
Can u Please help me out.
04-12-2013 12:52 PM
Which Colon part?
What do you need?
This is what you have for a variable named sample it takes values amd1_9- and amd1_10-
And you want an new variable new_sample to take what values exactly:
04-12-2013 12:54 PM
You have a variable called sample like this
Could you please be more specific what do you need the new variable to look like:
And for the other problem with removing the string, why do you need more ways?
what's wrong with what either I or LinLin offered?
04-12-2013 09:50 AM
Please try to use compress(variable,'-'); check the sample code
This code will remove the '-' hyphen from the variable.
Need further help from the community? Please ask a new question.