Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: seperate text in a variable repeatedly across many variables
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: seperate text in a variable repeatedly across many variables
Date
Fri, 25 Feb 2011 08:43:13 +0000
The syntax of your -foreach- call is wrong. Look again at the help to
see the forms alllowed and try
foreach v of var household_history_* {
split `v', p(";")
}
Nick
On Fri, Feb 25, 2011 at 8:36 AM, Ben Ammar <[email protected]> wrote:
> I'm new to Stata so please excuse if this question isn't the greatest:
>
> I want to seperate a text (string) across several variables. In each variable (household_history_1 up to household_history_100) there's a semicolon. So I thought of:
>
> .foreach household_history_* {
> .split household_history_*, p(";")
> .}
>
> unfortunately Stata says "too many variables specified". Maybe the approach is entirely wrong. I'd be very thankful for any comments!
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/