I need to feed different strings to strpos using a loop to create variables. I have found an old question on Statalist regarding the tokenize command's odd behaviour with the parse character, and I could circumvent it using the idea given there. In my humble opinion it's still a serious bug, but you may not need to agree (again an heresy, but I would highly recommend to Stata developers the functionality of SAS's scan function). However, as I see it trims the leading spaces off, and precisely that's why I would like to use a parse character different from blank space. May I ask your help how to keep all blanks in the tokens?
Thanks indeed!
Kazi
Code:
local regexp = "abc|a.b.| ab | ba| cd |.cd " tokenize `regexp', parse("|") while "`*'" ~= "" { disp "*`1'*" macro shift }
Kazi
Comment