Dear All, I have this data (in Chinese):
The purpose is to split items in A variable (with different number of items, usually separated by "、" or ",") into three variables, i.e., food, business, and tableware.
As far as I can tell, in general, (1) the last wanted variable `tableware' is in the last position (of `A') with "餐具", separated from prior item `business' with ","; (2) the second last wanted item `business' is ended with "年" (years in English), separated from prior item `food' with ",".; (3) the first wanted variable `food', unlike the other two variables (`business' and `tableware'), may contain more than one item of `A' (apart from the other items for `business' and `tableware'). Any suggestions are highly appreciated!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte store str73 A str39 food str20 business str15 tableware 1 "大腸麵線(1),已營業大於20年,有提供餐具" "大腸麵線(1)" "已營業大於20年" "有提供餐具" 2 "大腸麵線(2),已營業16-17年" "大腸麵線(2)" "已營業16-17年" "" 3 "大腸麵線(3)、滷肉飯,已營業5年,無提供餐具" "大腸麵線(3)、滷肉飯" "已營業5年" "無提供餐具" 4 "日式料理,已營業小於7年,有提供餐具" "日式料理" "已營業小於7年" "有提供餐具" 5 "日式料理(2),韓式料理,早點,已營業7年,有提供餐具" "日式料理(2),韓式料理,早點" "已營業7年" "有提供餐具" 6 "蛋餅,飲料,早點" "蛋餅,飲料,早點" "" "" 7 "漢堡,早點,已營業6-7年" "漢堡,早點" "已營業6-7年" "" 8 "蛋餅,早點,有提供餐具" "蛋餅,早點" "" "有提供餐具" end
As far as I can tell, in general, (1) the last wanted variable `tableware' is in the last position (of `A') with "餐具", separated from prior item `business' with ","; (2) the second last wanted item `business' is ended with "年" (years in English), separated from prior item `food' with ",".; (3) the first wanted variable `food', unlike the other two variables (`business' and `tableware'), may contain more than one item of `A' (apart from the other items for `business' and `tableware'). Any suggestions are highly appreciated!

Comment