I'm using Python to look at String A and String B.
String A only contains words (with \n newline character as each word is on its own line).
Next, I have String B, which contains lots of words, some which are found in String A and others that are not. I would like to only retain words in String B that are also in String A. The only problem here is that there are other characters after the words in String B that I would also like to retain.
Example:
String_A='apple/nbanana/nkiwi/npear'
String_B='cow|0.0|0.25|apple|0.0|0.99|pig|0.0|horse|0.2|banana|0.0|dog|0.2|kiwi|0.25|'
I would like String_C to have an end format of:
String_C='apple|0.0|0.99|banana|0.0|kiwi|0.25|'
Please see if you can assist! Thanks.