B.csv
Data =
Uk.Police
Abc Charity C.gov
Hello Services
A has organisation name and B has Charitable Organisations. Now i need to use for loop to tag Organisations where it find a match in B.csv. please help
thanks sorry for not being clear...does left join work if I have words which may be similar in other table? I need pattern matching so that I can find matches in %ge. if Org Name(row 1) has 3 words and if all three word matches from table 2(entire list) then it should give 100% else "No match found".
Table 1
Organisation Name
GALWAY UNIVERSITY FOUNDATION
GREYSTONES PRESBYTERIAN CHURCH
IRISH FOOTBALL ASSOCIATION LTD
IRISH YOUTH FOUNDATION
Table 2
Charity name
HOMEBOUND CRAFTSMEN TRUST
PAINTERS' COMPANY CHARITY
ROHBF
THE ROYAL OPERA HOUSE BENEVOLENT FUND
HERGA
HERGA WORLD DISTRESS FUND
THE WILLIAM GOLDSTEIN LAY STAFF BENEVOLENT FUND (ROYAL HOSPITAL OF ST BARTHOLOMEW)
I'm still not sure what you mean. Using examples you have what would matches be? I'm especially interested in the examples that show what you were describing with "if-else" clause.
Also you are saying that name in Table 1 should match list in Table 2. Do you mean that Table 2 stores lists where each word is separate? I guess, you have strings in both cases, so not sure where lists come into play.
What you describe sounds like fuzzy join, so there is a package called fuzzyjoin that might help you. I didn't use it myself, but it should be fairly straightforward.
Thanks, sorry I am new so may not be putting in good words .... one question, this code is giving me output as [1] 0 0 1 0 2. How can I transpose it in column so that I can see results in two columns
Beverly 0
Gloucester 0
Manchester-by-the-Sea Manchester
Nahant 0
Salem Salem
Could you please turn this into a self-contained reprex (short for minimal reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.
If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste the contents into the forum.