Hello, I'm having trouble with doing the following, can anyone help? The dataset has the keyword sale or sales at the beginning, middle, or end of a string that is bracketed[], quoted "", or neither. The dataset has an impressions variable and clicks variable for each observation and I need to indicate if sale or sales are at the beginning, middle or end of the string for sale or sales (separately) as well as keep the impressions and clicks to add up for each instance of each appearance of 'sale' or 'sales' in the string. I need this to create a summary table of the number of impressions and the number of clicks for sale at the beginning, middle, and end of the string then do the same for sales. Ex: Keyword Impressions Clicks [sale on gas grills] 10 2 "Gas grill sales" 0 0 green egg sale grills 420 336 I wrote code last night that worked, but its highly specific to this dataset. Is there a better way? Thanks very much for your help.
... View more