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]

st: parsing string


From   tashi lama <[email protected]>
To   <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index