Q012 - Decision_making: Decision making Single coded
Not back
When it comes to pain management, who makes the decision about which treatment you will take?
Normal
Q026 - Pain_state_recency: Pain state recency Multi coded
Not back | Min = 1 | Dummy
Autocode based on P3M_Pain_States and Recency_of_condition (most recent).
Normal
Q029 - Neck_back: Neck and back pain Multi coded
Not back | Min = 1 | Dummy
Autocode based on Pain_states_dummy and Body_location.
Normal
location1
... Text will be of Dynamic pattern. Need regex pattern that will help me to fetch the text between 2 lines which contains the keywords - 'Not back' and 'Normal'.
Hi @prasath17 …yes, there are multiple occurrences of those keywords (Not back and Normal). Need each of those texts which lies between these 2 keywords.
Note: If you want to remove the spaces from the start and end…please use .trim option. If you want to remove the spaces in the middle of the line then you have to apply regex.replace to the output…
@prasath17 … Thanks for the solution suggested. we are almost there.
Last part is working fine.
For the first part, instead of selecting the text after keyword ‘Not back,’ is there a way we can get the text starting from the next line which contains the keyword ‘Not back’?
Hi @DewanjeeS …I am not following you…Could you please highlight what you are looking for as a screenshot or using Highligher so that i will take a look?
Hi @prasath17 … I am attaching screenshot of the output we are currently getting with the regex provided.
As you can see, sometimes there are certain extra texts after the keyword ‘Not back’ (like : | Min =1 | Dummy) in that same line.
So, I am only looking for output like below pattern -
1st output -
When it comes to pain management, who makes the decision about which treatment you will take?
2nd output -
Autocode based on P3M_Pain_States and Recency_of_condition (most recent).
3rd output -
Autocode based on Pain_states_dummy and Body_location.
@prasath17 … 1st output coming fine (since there are no extra texts in the same line which contains the keyword ‘Not back’).
But if you see the 2nd & 3rd output, there are some extra texts coming as well (like : | Min = 1 | Dummy). I need to eliminate those as well.
@prasath17 … yes, i am able to retrieve this way as well… Thanks a ton.
Another query here - Is there a way we can do ‘OR’ operation with the ‘End string identifier’.
Sometimes the end identifier string can be the keyword ‘End’ as well, instead of ‘Normal’. So is there a way we can do something which will fetch the text between ‘Not back’ and ‘Normal’/‘End’?