Hi all, I have a simple question. Say I want to process filenames or variable names with consecutive numbers such like "abc1xyz", "abc2xyz", "abc3xyz", "abc4xyz", ... , "abc100xyz", so I need to generate a local list of these names. Directly using local list "abc1xyz......" makes the code be too long if there are too many consecutive numbers, so I would like to ask if there is any simple way to generate local list with consecutive numbers like this? Many thanks in advance!
PS: I know that if I want to do loop. I can use forvalues x=1/100 and if I want to keep or drop variables I can use keep abc*xyz. But still, sometimes I need the list, for example when I need to keep variables with odd numbers in this list "abc1xyz", "abc2xyz", "abc3xyz", "abc4xyz", ... , "abc100xyz".
Related Posts with How to generate a local list with numbers in a simple way
GLS regression STATACurrently I'm working on the replication (variation in time) of Charles W. L. Hill, & Phan, P. (…
How do I generate a numerical variable from a string variable?I have a variable with city names and I want to create a new variable which a unique number for each…
Migration analysis using "Difference in difference "Dear All, I am looking to the impact of migration on sales. Suppose we have two cities, one receiv…
Compare regression coefficientsHi, I am interested in assessing the relationship between number of GP visits (IV) and wellbeing (D…
Include void in a loopHello, I coded an optimization and I would like to repeat that optimization for subsamples randomly…
Subscribe to:
Post Comments (Atom)
0 Response to How to generate a local list with numbers in a simple way
Post a Comment