I have documents such as : 

> 
> President Dr. Norbert Lammert: I declare the session open.
> 
> 
> I will now give the floor to Bundesminister Alexander Dobrindt. 
> 
> 
> (Applause of CDU/CSU and delegates of the SPD) 
> 
> 
> Alexander Dobrindt, Minister for Transport and Digital Infrastructure: 
> 
> 
> Ladies and Gentleman. We will today start the biggest investment in infrastructure that ever existed, with over 270 billion Euro, over 1 000 projects and a clear financing perspective. 
> 
> 
> (Volker Kauder [CDU/CSU]: Genau!)
> 
> 
> (Applause of the CDU/CSU and the SPD) 
> 
> 
> 

And when I read those .txt documents I would like to create a second column indicating the speaker name.

So what I tried was to first create a list of all possible names and replace them.. 

```
library(qdap)

members <- c("Alexander Dobrindt, Minister for Transport and Digital Infrastructure:","President Dr. Norbert Lammert:")
members_r <- c("@Alexander Dobrindt, Minister for Transport and Digital Infrastructure:","@President Dr. Norbert Lammert:")

prok <- scan(".txt", what = "character", sep = "\n")
prok <- mgsub(members,members_r,prok)

prok <- as.data.frame(prok)
prok$speaker <- grepl("@[^\\@:]*:",prok$prok, ignore.case = T)

```

My plan was to then get the name between @ and : via regex if speaker == true and apply it downwards until there is a different name (and remove all applause/shout brackets obviously), but that is also where I am not sure how I could do that.