I need to extract text between start and end values which are in columns. The text should be in a new column.
The columns are:
text – text from a document read in using readtext
text_section – a character value categorising a section of text. Each text_section is delimited by:
start_text – a character string at the start of a text section
end_text – a character string at the end of a text section
The new column I would like:
section_text – the string between start_text and end_text in text
I’ve tried using str_extract but just get NAs
(I have confirmed using str_match that the text does contain the start and end text)
Thanks!
Michael JDS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1