I'm trying to remove words in a list (a .txt file) using sed, but it is not working correctly. The output file removes the words it should remove and also parts of words it shouldn't remove.
This is the code that I've tried:
sed -E 's/('"$(tr '\n' '|' < listOfWords.txt )"')//gI' file.txt > output.txt
Example of input:
I would love to try or hear the sample audio your app can produce. I do not want to purchase, because I've purchased so many apps that say they do something and do not deliver.
Can you please add audio samples with text you've converted? I'd love to see the end results.
Thanks!
Expected output:
would love try hear sample audio app can produce. do want purchase, because ve purchased many apps say do something do deliver.
Can please add audio samples text ve converted? d love see end results.
list of words sample:
...
I
to
or
the
your
not
so
that
they
and
you
with
Thanks
...