Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: String task


From   Daniel Marcelino <dmsilva.br@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: String task
Date   Fri, 1 Apr 2011 12:51:56 -0300

Hello all,

I have I task with string that is split a string into two vars.
So every character before first "/" slash if is there,  must be copied
to var1. Also, everything after  "/" slash or if there is no "/"
everything in the cell must be placed into var2.
How can I do it?


gen str8 day = ""
input
"01/06/90"
"07"
"02/01"
"30/01"
"10"
end
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index