08-23-2014 06:29 AM
I have a string variable, the observations of the variable are business scopes of firms. I want to find out from the business scope whether a firm produces commodities.
Primarily, I use index function to find the word "production" or "produce" and it works well. But I have problems, because in some observations "production facility",
"production skill" and "production" occur simultaneously. How could I decide whether these firms really produce commodites?
08-23-2014 06:53 AM
This is up to you how you define production scopes. If you want to consider observations with production facility, production skill and production as business scope then you have count all of them in business scope.
08-23-2014 08:56 PM
alternatively you are try to find two words something like index(variable,'production')>0 and index(variable,'commodities')>0, only if both the conditions are satisfied we can count it.
by pearl regular expressions it will be like
prxmatch('/production|produce/',variable)>0 and prxmatch('/commodities1|commodities2/',variable)>0