Bookmark and Share

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: splitting strings


From   Daniel Henriksen <[email protected]>
To   [email protected]
Subject   Re: st: splitting strings
Date   Thu, 10 Feb 2011 14:08:49 +0100

I'm sorry, the example is unreadable.
In observation one :
V1: hello John Smith how are you?
V2 John Smith
V1_1 hello
V1_2 how are you?

Observation two:
V1: I’m fine Jane, how about you?
V2: Jane,
V1_1 I'm fine
V1_2 how about you?

So the splitting of V1 varies from observation to observation
depending on the string text in V2
Hope this makes sense

/Daniel

2011/2/10 Daniel Henriksen <[email protected]>:
> Hello statalist
>
> I have a question regarding splitting up strings.
>  Is it possible to split up a string using a string from another
> variable defined in the same observation. I’m thinking of using the
> “split” command.
> Here’s an example, where V1 is the string I’d like to split and V2 is
> where I’d like to split (different from each observation). V1_1 and
> V1_2 are the results of the splitting
> V1                                              V2
> V1_1          V1_2
> hello John Smith how are you?      John Smith     hello           how are you?
> I’m fine Jane, how about you         Jane,              I’m fine
> how about you?
>
>
> Sorry about the ridiculous example.
> Hope my question is clear
> Regards
> Daniel
>
> --
> Daniel Henriksen
> Ph.d. studerende, læge
> Odense Universitetshospital
>
> *
> *   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/
>



-- 
Daniel Henriksen
Ph.d. studerende, læge
Infektionsmedicinsk afd Q / Akut Modtage Afdelingen
Odense Universitetshospital
Bygning 2, 1. sal
Sdr. Boulevard 29
5000 Odense C

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index