I am looking to searching within a RTF formatted text note for specific text snippets (specifically “immunocompromised” or similar). I have tried to do a RTF to text conversion previously with little success.
Here is the text note (RTF):
{\rtf1\ansi\ansicpg1252\uc1\deff0{\fonttbl
{\f0\fnil\fcharset0\fprq2 Arial;}
{\f1\fswiss\fcharset0\fprq2 Arial;}
{\f2\froman\fcharset2\fprq2 Symbol;}}
{\colortbl;\red0\green0\blue0;\red255\green255\blue255;}
{\stylesheet{\s0\itap0\nowidctlpar\f0\fs24 [Normal];}{*\cs10\additive Default Paragraph Font;}}
{*\generator TX_RTF32 15.1.531.502;}
\deftab1134\margl0\margt0\margr0\margb0\widowctrl\formshade\sectd
\headery720\footery720\pgwsxn12240\pghsxn15840\marglsxn1440\margtsxn1440\margrsxn1440\margbsxn1440\pard\itap0\nowidctlpar\plain\f1\fs18 CNC - Multiple calls from K last week regarding grocery shopping.\par\par Reports that she has no friends or family able to shop for her, and that she is unable to shop\par due to being immunocompromised.\par\par Advised that community based care services are stretched to the limit.\par Suggested online shopping.\par K has looked into this, but upset that some items are out of stock.\par\par Advised that this is the issue for the whole population…\par Advised applying for ‘Priority Online Shopping’.\par This is for vulnerable people. W Inc are attempting to provide these \par shoppers with their groceries.\par }
I want to remove all of the non-bold characters to leave the text entry as:
CNC - Multiple calls from K last week regarding grocery shopping. Reports that she has no friends or family able to shop for her, and that she is unable to shop\par due to being immunocompromised. Advised that community based care services are stretched to the limit. Suggested online shopping. K has looked into this, but upset that some items are out of stock. Advised that this is the issue for the whole population… Advised applying for ‘Priority Online Shopping’. This is for vulnerable people. W Inc are attempting to provide these shoppers with their groceries.}
I have tried String Replace (Dictionary) but that only replaces whole entries.
I have tried Column Expressions but I’m sure that either it doesn’t work, OR I have the wrong code (see picture)
So I am left with just using String Replacer using each row and variant, which is cumbersome and very very lengthy (I have 323,350 notes to search just for 01.01.2020 til yesterday!)
Can anyone help me with a more efficient way to remove a range of strings from within a text note?
As always, thanks in advance.
A