Background: I have a dataset in R Studio containing around 1 million rows and 10 different columns. Name of dataframe = Pontus_DF I am interested in one particular column, called "Notes".
Desired action and output: I want to go through the column "Notes" for all the rows and identify the pattern "MIC?:" and then extract the word before MIC?: + the pattern itself + the word after MIC?: and put in a new column called "New_Notes". The problem is that the number of columns that I want to generate per row is not fixed, but depends on how many times the pattern "MIC?:" is found in the column "Notes" for that particular row.
Hope the desired output was clear and I'm happy to receive any comments about how to further clarify my problem.
All the best, Pontus