Dear all,
I have a question about how to identify commonn elements (words) between two string variables. My variable of interest is firm names as the followings.
var1
"AKER CLEAN CARBON AS"
"AKER CLEAN CARBON AS"
"AKER KVAERNER SUBSEA"
"KVAERNER ASA"
var2
"AKER CLEAN CARBON"
"BADE OTTO MORTEN"
"AKER KVAERNER SUBSEA"
"KVAERNER ASA, LYSAKER"
As you see, var1 and var2 share some common parts except the second one. I'd like to make var3 like this.
var3
"AKER CLEAN CARBON"
" "
"AKER KVAERNER SUBSEA"
"KVAERNER ASA"
In short, var3 has the intersection words between var1 and var2. How can I do this?
Thank you in advance.
I have a question about how to identify commonn elements (words) between two string variables. My variable of interest is firm names as the followings.
var1
"AKER CLEAN CARBON AS"
"AKER CLEAN CARBON AS"
"AKER KVAERNER SUBSEA"
"KVAERNER ASA"
var2
"AKER CLEAN CARBON"
"BADE OTTO MORTEN"
"AKER KVAERNER SUBSEA"
"KVAERNER ASA, LYSAKER"
As you see, var1 and var2 share some common parts except the second one. I'd like to make var3 like this.
var3
"AKER CLEAN CARBON"
" "
"AKER KVAERNER SUBSEA"
"KVAERNER ASA"
In short, var3 has the intersection words between var1 and var2. How can I do this?
Thank you in advance.
Comment