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: parsing string


From   tashi lama <ltashi32@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: parsing string
Date   Tue, 24 Jul 2012 20:41:23 +0000

Hello all, 
        date2   hits                                                          title |
     |-----------------------------------------------------------------------------|
  1. | 18630    236                                                           2011 |
  2. | 18645    321                                    Expect Strong Dec From iPad |
  3. | 18828    245   Reasons To Believe In Momentum: June Drivers Continue + Sep. |

gen h=hits+" "+date2+" "+title

   
        date2   hits                                                          title                                                                        h |
     |------------------------------------------------------------------------------------------------------------------------------------------------------|
  1. | 18630    236                                                           2011                                                           236 18630 2011 |
  2. | 18645    321                                    Expect Strong Dec From iPad                                    321 18645 Expect Strong Dec From iPad |
  3. | 18828    245   Reasons To Believe In Momentum: June Drivers Continue + Sep.   245 18828 Reasons To Believe In Momentum: June Drivers Continue + Sep. |

  levelsof h, local(g) clean 
di "`g'"
236 18630 2011 245 18828 Reasons To Believe In Momentum: June Drivers Continue + Sep. 321 18645 Expect Strong Dec From iPad

Could someone suggest to get following using some string functions or some techniques because I want to use the following in ttext since ttext requires string(variable titles here) to be inside quotation marks. 

236 18630 "2011" 245 18828 "Reasons To Believe In Momentum: June Drivers Continue + Sep." 321 18645 "Expect Strong Dec From iPad"

Thanx guys... 		 	   		  
*
*   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