Data frame one.
structure(list(trial_id = c(2022L, 2023L, 2123L, 2184L, 3883L,
4434L), ctri_number = c("CTRI/2018/02/011794 ", "CTRI/2017/08/009517 ",
"CTRI/2019/05/019036 ", "CTRI/2017/12/010935 ", "CTRI/2017/09/009746 ",
"CTRI/2016/06/007055 "), name = c("National Institute of Allergy and Infectious Diseases NIAIDMaryland USA",
"Jawaharlal Nehru Medical College", "KLEU Ayurveda Pharmacy",
"Amgen Inc", "Dr Arunkumar", "ALVAS EDUCATION FOUNDATION"), type_of_sponsor = c("' Government funding agency '",
"' Government medical college '", "' Research institution '",
"' Pharmaceutical industry-Global '", " Other [Self sponsored] '",
"' Private hospital/clinic '"), address = c("' USA '", "' Jawaharlal Nehru Medical College, Aligarh Muslim University, Aligarh-202001 '",
"' KLEU Ayurveda Pharmacy, Khasbhag, Belgaum, Karnataka '", "' One Amgen Center Drive\n\n\nThousand Oaks, CA USA\n\n\n91320 '",
"' Room no 32 ,Department of Periodontics , Government Dental college , Trivandrum '",
"' ALVAS EDUCATION FOUNDATION ALVAS COLLEGE OF PHYSIOTHERAPY\n\n\nMoodabidri - 574227\n\n\nSouth Canara District\n\n\nKarnataka '"
)), row.names = c(NA, 6L), class = "data.frame")
Data frame two.
structure(list(distinctOrganizations = c("A AMMU", "A and U tibbia college and hospital",
"A Arumuga kani", "A KIREETI", "AAMIR ZUBAIR SHAIKH", "Aansu Susan Varghese"
)), row.names = c(NA, 6L), class = "data.frame")
Using all the data fields from data frame 2(distinctOrganizations) I have to pull out the rows from data frame one which match the values in the name column.
However, each data field should produce a specific .csv file.
How can I achieve this?
Possible Outcome- A CSV file similar to the image.

