Extract exact number

abbaszavarabbaszavar Member Posts: 11 Contributor I
edited November 2018 in Help

Hi there 

 

I have an excel file in one column and each row include health information regarding a patient.

How can I extract the amount of blood pressure in each row?

Example: bp = 120 (how can I extract 120 in a seperate column in the output?)

 

Please advise.

 

Thanks,

Abbas

 

Best Answer

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
    Solution Accepted

    hello @abbaszavar - it is good to have you here.  I would use Generate Attributes (best operator in RapidMiner IMHO) and do something like this if your column is labeled att1:

     

    bloodPressure                 parse(suffix(att1, length(att1) - index(att1,"=") - 2))

     

    Scott

     

Answers

  • abbaszavarabbaszavar Member Posts: 11 Contributor I

    Hi Scott,

     

    Thanks for your reply.

    It is just works if my variable was in the end of the line. Actually sometimes I have the same variable and its amount in the beginning or middle the line.

    Could you please let me know how I can modify algorithm to can cover all possibilities?

     

    Thanks in advance,

    Abbas

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager

    hello @abbaszavar - in that case you should probably use a RegEx expression and slice+dice from there.  :)

     

    Scott

     

Sign In or Register to comment.