We have users copy from an Excel Q&A template into a notes field in our CRM. It dumps the text (questions and answers all together) in as one large block in a single field which ends up being split up by line breaks. I need to parse out the answers to the questions and so far have had mixed success using text to columns and a few tricks. However, some users are altering the template which is preventing all the Q&A from parsing out successfully.
I was wondering if there is a way to use GetLeft and GetRight in combination to get the text between parts of a long string? I can't use character based placement to parse out since the start and stop point within the string can widely vary.
I tried using GetRight([Note Field], "String I want to search to get text to right of") first and it just cut off the first letter or two rather than getting all the text to the right of what I was looking to pull. My thought was to get the "right" portion and then nest/combine that with a GetLeft statement to search to the left of another string and ultimately get what is in between the two questions which should be the answer.
RegEx seems pretty complicated so looking for a simpler solution
put your search term into a field - let's call it SearchTerm:
for right - use:
regex_replace([NoteField],"(.*)"+[SearchTerm]+".*","$1")
for left - use:
regex_replace([NoteField],".*"+[SearchTerm]+"(.*)","$1")