Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: strings hnadling


From   "Alexander Nervedi" <[email protected]>
To   [email protected]
Subject   st: strings hnadling
Date   Wed, 08 Feb 2006 01:03:42 +0000

Hi List users,

I have data which has been entered awkwardly.

Instead of taking each a seperate variable for each item - all items of a category are entered together in a variable.

ID Grp1 Grp2 Grp3 Grp4
001 2;3;4 10;99;2 01 11,2,25,2,3


I'd like to convert this to a dataset that looks like

ID Grp1 Grp2 Grp3 Grp4
001 3 3 1 5

i.e. the count of the number of semi-colons within each variable. I am sure there is a neat way of doing this but I am missing it. So i thought i'd write in and ask for u r help.

thanks

Alnerdy

_________________________________________________________________
Don�t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index